Operating System - OpenVMS
1752402 Members
5482 Online
108788 Solutions
New Discussion

porting C to C++ on OpenVMS

 
Dennis Handly
Acclaimed Contributor

Re: porting C to C++ on OpenVMS

Even if you decide to still use the C compiler, compiling with C++ will give you "lint clean" source that is fully prototyped. (Hopefully you will centralize the prototypes in headers.)

Note that declarations like void foo() are valid for C++ but not for scummy C. You need to add void: void foo(void)

You may also want to compile with C99 where missing prototypes is deprecated.

One difference between C and C++ is that const has internal linkage in C++:
const struct foo bar = { 99 };
Change to:
extern const struct foo bar = { 99 };