Just a question

Giorgos Keramidas keramida at ceid.upatras.gr
Tue Jul 25 00:56:02 UTC 2006


On 2006-07-24 19:22, "Michael D. Norwick" <mnorwick at centurytel.net> wrote:
> The following warnings were generated by a GhostScript build during
> 'portmanager -u':
>
> ./src/gsfunc0.c: In function `function_Sd_enum_ptrs':
> ./src/gsfunc0.c:37: warning: traditional C rejects ISO C style function
> definitions
> ./src/gsfunc0.c: In function `function_Sd_reloc_ptrs':
> ./src/gsfunc0.c:48: warning: traditional C rejects ISO C style function
> definitions
> ./src/gsfunc0.c: In function `fn_gets_1':
> ./src/gsfunc0.c:74: warning: traditional C rejects ISO C style function
> definitions
> ./src/gsfunc0.c: In function `fn_gets_2':
>
> This is just a small clip of the warning when building one .c file.  The
> build generated many of these warnings then aborted for reasons unknown
> to me right now.  I just wanted to know what this particular warning is
> in reference to.  Using GCC 3.4.4 (20050518).

This is the warning enabled by -Wtraditional, and you get it for all
functions that have full prototypes, i.e.:

# giorgos at gothmog:/tmp/foo$ cc -Wtraditional foo.c
# foo.c: In function `foo':
# foo.c:4: warning: traditional C rejects ISO C style function definitions
# foo.c: In function `main':
# foo.c:10: warning: traditional C rejects ISO C style function definitions
# giorgos at gothmog:/tmp/foo$ cc -Wtraditional bar.c
# giorgos at gothmog:/tmp/foo$ diff -u bar.c foo.c
# --- bar.c       Tue Jul 25 03:53:59 2006
# +++ foo.c       Tue Jul 25 03:52:13 2006
# @@ -1,12 +1,12 @@
#  #include <stdio.h>
#
# -int foo ()
# +int foo (void)
#  {
#      printf("foo\n");
#      return 0;
#  }
#
# -int main()
# +int main(void)
#  {
#      return foo();
#  }
# giorgos at gothmog:/tmp/foo$

Either the original GhostScript sources or the port uses -Wtraditional...



More information about the freebsd-hackers mailing list