1834458 Members
3117 Online
110067 Solutions
New Discussion

Re: cc compile

 
Linda Lux
Regular Advisor

cc compile

When compiling with cc on HP-UX 11.23 OS on hp9000 server, getting this warning:
cpp: "/usr/include/sys/stdsyms.h". line 19: warning 2001: Redefinition of macro. _INCLUDE_POSIX_SOURCE
the compile command looks like this:
cc -c -I/opt/mqm/inc -I. -Ae +U4 +DA1.0 +w3 +O2 -lmqm getmsgs.c

The c programs compile - but need to know what to do with the warning.

Let me know if more info is needed.
If it isn't one thing, it's another
2 REPLIES 2
Steven Schweda
Honored Contributor

Re: cc compile

> [...] but need to know [...]

This may depend on how much you care.

> [...] Redefinition of macro [...]

So, in how many places is
_INCLUDE_POSIX_SOURCE getting defined? The
warning message tells you where the second
one happened. Where's the first one? And
whose fault is it?

> [...] -Ae +U4 +DA1.0 +w3 [...]

I know nothing. Does any of those imply a
definition for _INCLUDE_POSIX_SOURCE?

> [...] getmsgs.c

Can't see it. Can you provide a small
failing test case?
Dennis Handly
Acclaimed Contributor

Re: cc compile

If you are getting warning 2001 on _INCLUDE_POSIX_SOURCE, it means you have illegally defined that variable, instead of _POSIX_SOURCE.

To debug macros you can use:
cc ... -Wp,-C,-G -E > getmsgs.i

Then look for _INCLUDE_POSIX_SOURCE.

>-Ae +U4 +DA1.0 +w3 +O2 -lmqm getmsgs.c

There is a +u4 but not +U4.
The use of +DA1.0 is not supported after 10.10, replace by +DAportable.
You should really have your libs after your sources/objects: getmsgs.c -lmqm
You shouldn't be using +w3 to suppress all warnings, better to use +W with a list of messages to suppress.