public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: "Burkhardt, Glenn UTAS" <Glenn.Burkhardt@utas.utc.com>
To: "pthreads-win32@sourceware.org" <pthreads-win32@sourceware.org>
Subject: warning with _POSIX_C_SOURCE and PTW32_LEVEL
Date: Wed, 11 Sep 2013 18:24:00 -0000	[thread overview]
Message-ID: <86DD1E0283018749B08AA5A580CB853E39FCF43D@NHC0EX54.goodrich.root.local> (raw)

I'm seeing a CPP warning when _POSIX_C_SOURCE is defined


$ cpp -D_POSIX_C_SOURCE=200809L pthread.h > /dev/null
pthread.h:108:0: warning: "PTW32_LEVEL" redefined [enabled by default]
pthread.h:95:0: note: this is the location of the previous definition

$ cpp -D_POSIX_C_SOURCE=200809L sched.h > /dev/null
sched.h:64:0: warning: "PTW32_SCHED_LEVEL" redefined [enabled by default]
sched.h:51:0: note: this is the location of the previous definition

$ cpp --version
cpp.exe (GCC) 4.7.0

and my reading of the code in pthread.h indicates that the warning is valid:

first:
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 199309
#undef PTW32_LEVEL
#define PTW32_LEVEL 1
/* Include 1b, 1c and 1d */
#endif

defines PTW32_LEVEL, and then

#if ( defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112 )  || !defined(PTW32_LEVEL)
#define PTW32_LEVEL PTW32_LEVEL_MAX
/* Include everything */
#endif

so when _POSIX_C_SOURCE=200809L, PTW32_LEVEL gets defined twice.

Seems like a bug...

                 reply	other threads:[~2013-09-11 18:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86DD1E0283018749B08AA5A580CB853E39FCF43D@NHC0EX54.goodrich.root.local \
    --to=glenn.burkhardt@utas.utc.com \
    --cc=pthreads-win32@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).