[Pw_forum] compilation error
James J Ramsey
jjr19 at zips.uakron.edu
Wed Dec 9 21:17:25 CET 2009
On Wed, Dec 9, 2009 at 2:58 PM, Shane Taylor
<shanetaylor at u.boisestate.edu> wrote:
> Dear all,
>
> I am using fedora linux, when I try to compile I get the following message:
> cc -O3 -D__GFORTRAN -D__FFTW -I../include -c memstat.c
> In file included from /usr/include/stdio.h:910,
> from /usr/include/malloc.h:27,
> from memstat.c:25:
> /usr/include/bits/stdio.h: In function ‘memstat_’:
> /usr/include/bits/stdio.h:38: error: nested function ‘vprintf’ declared
> ‘extern’
> /usr/include/bits/stdio.h:37: error: static declaration of ‘vprintf’ follows
> non-static declaration
> /usr/include/bits/stdio.h:46:
-- snip --
> Can someone explain exactly why this doesn't work and how I might go about
> fixing it?
See this e-mail in the archives:
http://www.democritos.it/pipermail/pw_forum/2009-October/014531.html
Basically, an #include statement is used *inside* a C function, which
is both bad style and contrary to the ISO C99 spec. The compiler on
your version Fedora is enforcing the spec.
More information about the Pw_forum
mailing list