help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When some files need special compilation flags, ...


From: Philip Guenther
Subject: Re: When some files need special compilation flags, ...
Date: Wed, 9 Jul 2008 18:42:56 -0600

On Mon, Jul 7, 2008 at 11:20 PM, x z <address@hidden> wrote:
> I am compiling C programs using gcc on Solaris.  Solaris need some special
> compilation flags to ensure POSIX conformance.  For example, if one needs to
> call sigwait() with the POSIX syntax (and semantics too?), one needs to add
> a -D_POSIX_PTHREAD_SEMANTICS flag to the compilation command, according to
> sigwait()'s man page.  In other cases, one may need to add -D_POSIX_C_SOURCE
> for multithreaded programs.
> Based on my experience, Solaris does not seem to be very robust and the
> definition of these flags may produce a compilation error when included in
> compiling files that do not need these flags.

<OT>
I'll suggest that your problems with using a consistent set of defines
probably indicate a deeper problem or misunderstanding and that you
should consider describing them on a Solaris news group
(comp.os.solaris?) or otherwise try to resolve them instead of mixing
compilation options as a workaround.

(Personally, I've found it works to just compile everything with
    -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_REENTRANT
Code that can't be compiled with those is broken code.  Fix the code,
not the compilation environment.)

</OT>


Philip Guenther




reply via email to

[Prev in Thread] Current Thread [Next in Thread]