Menu

Does -Wsign-conversion work?

Osito
2007-08-26
2012-09-26
  • Osito

    Osito - 2007-08-26

    I tried searching the web for this, since it's really a gcc question and not Dev-C++, but I had no luck.

    I want to use the -Wsign-conversion option to check for places where I've set an unsigned int to -1, for instance. I can use -Wconversion OK, but it gives me tons of warnings I don't care about. When I instead add -Wsign-conversion to my compiler options, it gives me this:

    Compiler: Default compiler
    Building Makefile: "C:\Bittware\chamber\Makefile.win"
    Finding dependencies for file: C:\Bittware\chamber\chamber.c
    Executing make...
    mingw32-make.exe -f "C:\Bittware\chamber\Makefile.win" all
    "c:\program files\tortoisesvn\bin\subwcrev.exe" .\ .\version\version.repo .\version.h > .\version\log.txt
    mingw32-gcc.exe -c chamber.c -o chamber.o -I"C:/mingw/include" -I"C:/mingw/include" -Wsign-conversion
    cc1.exe: error: unrecognized command line option "-Wsign-conversion"
    mingw32-make.exe: *** [chamber.o] Error 1
    Execution terminated

    Is that option not supported in gcc-3.4.2? Or is it just my mingw version of it? Maybe I typed something wrong?

     
    • Soma

      Soma - 2007-08-26

      If my builds are any indication, '-Wsign-conversion' is only available to GCC 4.3 series and above.

      Soma

       
    • Anonymous

      Anonymous - 2007-08-26

      The manuals for all versions upto 4.2 are at: http://gcc.gnu.org/onlinedocs/, quite clearly for all these versions no such is documented. Which is my way of saying RTFM.

      Also learn to search effectively; what were you searching for if you did not come across the compiler's own documentation!?

      Clifford

       
      • Osito

        Osito - 2007-08-26

        LMFAO, that's exactly what I was doing, reading docs on the site you mentioned. It is not at all clear to me that there are version requirements for my particular warning:

        http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

        It appears to be a list of options supported by the gcc compiler. I guess it's not.

         
    • Anonymous

      Anonymous - 2007-08-26

      >> It appears to be a list of options supported by the gcc compiler. I guess it's not.

      No, that is exactly what it is, what don't you understand about version numbers!? It is a list of option ssupported by version 4.3 of teh compiler You are looking at the "Current development" (i.e. 4.3) manual. What version of GCC are you using?

      Dev-C++ ships with 3.4. Read the appropriate version of the manual and you will see that the option is not documented. If it is not documented it is reasonable to assume that it is not supported!

      The manual for 3.4 is: http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/

      If one exists no doubt Soma can point you in the direction of a MinGW 4.3 build, but is it worth it just for a warning?

      Clifford

       
      • Osito

        Osito - 2007-08-27

        Your warm and gentle words have touched my heart.

         
        • Anonymous

          Anonymous - 2007-08-27

          Oh sorry about that, I was trying to reach your brain. ;-)

           

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.