Open MPI logo

Hardware Locality Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: Re: [hwloc-devel] [hwloc-svn] svn:hwloc r1986
From: Samuel Thibault (samuel.thibault_at_[hidden])
Date: 2010-04-21 12:26:43


Jeff Squyres, le Wed 21 Apr 2010 09:04:11 -0400, a écrit :
> On Apr 21, 2010, at 8:47 AM, Bert Wesarg wrote:
>
> > From that page:
> >
> > If you are writing a header file that must work when included in
> > ISO C programs, write __typeof__ instead of typeof. See Alternate
> > Keywords.
> >
> > > Modified: trunk/src/topology.c
> >
> > That does not look like a header for me.
>
> Right, but gcc complained when used with -std=c99 unless it was __typeof__. I did not check to see if icc or pgcc accepted typeof. I read that text to be "if you want portable code, use __typeof__ instead of typeof."

Err, putting underscores doesn't magically makes something recognized by
compilers :)

The reason why the documentation tells about headers and not .c files is
that while you control which standard your .c files are compiled under
(e.g. -std=c99), you do not control which standard your .h files will be
compiled under by other applications, that's why you need a way to tell
a compiler "don't complain about these extensions I know you support but
warn about because you were given -std=c99).

Here, typeof is not c99, and that's why gcc complains when given
-std=c99 (instead of the default -std=gnu99). Putting underscores just
hides the bug...

Samuel