#312 -Wmissing-prototypes causes stdio.h problems

component_package
closed
gcc (462)
fixed
Aged_issue
2013-01-27
2003-03-09
Jim Barton
No

In mingw/include/stdio.h, the inline declarations of
vsnprintf()
and vsnwprintf() are not preceeded by a separate prototype
declaration. When using the -Wmissing-prototypes option on
gcc, this causes a warning.

I like to compile with all warnings on, and treat
warnings as
errors, so this is a problem. It is easily corrected by
supplying a prototype.

Discussion

  • Luke Dunstan

    Luke Dunstan - 2003-03-10
    • labels: 456608 --> mingw runtime (deprecated use WSL)
    • priority: 5 --> 1
    • status: open --> pending-wont-fix
     
  • Luke Dunstan

    Luke Dunstan - 2003-03-10

    Logged In: YES
    user_id=30442

    See this message about a previous report of the same
    problem:

    http://sourceforge.net/mailarchive/message.php?
    msg_id=4011668

    You didn't say which compiler version you are using, and
    since I can't reproduce this with current versions I assume
    you are using GCC 2, so the message above will explain why
    this will not be fixed unless somebody submits a patch.

     
  • Earnie Boyd

    Earnie Boyd - 2003-03-10
    • status: pending-wont-fix --> closed-wont-fix
     
  • Jim Barton

    Jim Barton - 2003-03-12

    Logged In: YES
    user_id=73105

    Here is the command line I use. This is with the 3.2 compilers:

    c:/mingw/bin/gcc -Bc:/mingw/bin/ -nostdinc -fno-inline -O1
    -g -Wall -Wcast-qual -Wconversion -Wimplicit
    -Wmissing-declarations -Wmissing-prototypes
    -Woverloaded-virtual -Wstrict-prototypes -Wundef -W
    -Wunused -fno-exceptions -mthreads -DDEBUG
    -DUSE_NEW_TOOLS -DBOOTARCH=X86 -DOSTYPE=Win32 -UDEBUG
    -DPPC=1 -DX86=2 -DMIPS=3 -DSPARC=4 -Ic:/mingw/include
    -Ic:/mingw/lib/gcc-lib/mingw32/3.2/include
    -Ic:/mingw/include/c++/3.2
    -Ic:/jmb/sb/mainline/dev-win32/root/include/make/system/dev-win32
    -I../../common/include -I../../obj/dev-win32/include
    -Ic:/mingw/include
    -Ic:/jmb/sb/mainline/dev-win32/root/include
    -Ic:/jmb/sb/mainline/dev-win32/root/private/include
    -I../lib -I. -o examples/outline.o -c ../examples/outline.c
    In file included from ../examples/outline.c:24:
    c:/mingw/include/stdio.h:226: warning: no previous prototype
    for `vsnprintf'
    c:/mingw/include/stdio.h:382: warning: no previous prototype
    for `vsnwprintf'
    In file included from ../lib/expat.h:17,
    from ../examples/outline.c:25:
    c:/mingw/include/stdlib.h:301: warning: no previous
    prototype for `strtof'
    c:/mingw/include/stdlib.h:312: warning: no previous
    prototype for `wcstof'

     
  • Danny Smith

    Danny Smith - 2003-03-14
    • priority: 1 --> 5
    • assigned_to: earnie --> dannysmith
    • status: closed-wont-fix --> open-later
     
  • Danny Smith

    Danny Smith - 2003-03-14

    Logged In: YES
    user_id=11494

    I am reopening this because extern __inline__ in
    headers needs to be fixed, but not by simply adding
    prototypes.

    As explained by Jim Myers in this post:

    http://gcc.gnu.org/ml/gcc-patches/2003-
    03/msg01300.html

    "Roughly, the semantics of plain inline and extern inline
    are swapped between C99 and gnu89. In C99, an inline
    function is exported only if some declaration - possibly
    appearing after the function is defined -
    specifies "extern" or does not specify "inline", whereas
    in gnu89 "extern inline" means the function is not
    exported"

    Not a problem at the moment because gcc does not
    implement C99 inline semantics correctly, but this will
    need to be addressed when it does.

     
  • Earnie Boyd

    Earnie Boyd - 2012-10-19
    • status: open-later --> closed-out-of-date
     
  • Earnie Boyd

    Earnie Boyd - 2012-10-19

    Since we are well past GCC 3 I'm closing this as out-of-date.

     
  • Earnie Boyd

    Earnie Boyd - 2013-01-27
    • labels: mingw runtime (deprecated use WSL) --> gcc
    • status: closed-out-of-date --> closed
    • resolution: --> fixed
    • category: --> Aged_issue
    • milestone: --> component_package
     

Log in to post a comment.