Operating System - HP-UX
1834772 Members
2943 Online
110070 Solutions
New Discussion

Re: export reserved keyword

 

export reserved keyword

I am trying to build our application on a brand new HP R390 with
HP aC++ B3910B A.01.27
HP aC++ B3910B A.01.19.02 Language Support Library
the op. sys version is the 10.20.

We get an error (future one) in one of the HP include file shippet with the compiler software :

Error (future) 908: "/usr/include/nfs/nfs.h", line 600 # 'export' is a C++
keyword, even if it is not currently used as a keyword by aCC. You should
avoid using it as an identifier.
extern int exportfs(const char *, const struct export *);
^^^^^^
Warning: 1 future errors were detected and ignored. Add a '+p' option to detect and fix them before they become fatal errors in a future release. Behavior of this ill-formed program is not guaranteed to match that of a well-formed program

Is there any "clean" solution to my problem?

Thanks.
1 REPLY 1
Bruce Regittko_1
Esteemed Contributor

Re: export reserved keyword

Hi,

While it will not matter now, a future release of the compiler may use the "export" keyword and then your program will not compile. The obvious solution is to change the name of the "export" identifier to something else, say, "exprt", in all of your source files.

Be careful how you change "export". You don't want to change "exportfs" to "exprtfs". From vi, you can issue

:%s/\/exprt/g

to hit the whole file. (The \< and \> anchors the beginning and end of a word.)

--Bruce
www.stratech.com/training