Menu

#538 quell compilation warnings

open
4
2008-02-08
2008-02-08
No

Hello,

I'm working on making our code (which uses Tcl extensively) compile cleanly with most GCC warnings enabled and some of the issues reported are coming from tcl/tk headers.

The attached patch fixes the issues encountered from including tcl.h, which includes shadow warnings for 'index' declared on many functions and checking HAVE_DECLSPEC's value without it being set. The patch just quells the shadow but changing the function signatures to not name the argument index (maybe call it idx) would also work.

The warning flags being cleaned up are as follows:

-W -Wall -Wundef -Wfloat-equal -Wshadow -Wunreachable-code -Winline -Wconversion

Cheers!
Sean

Discussion

  • Sean Morrison

    Sean Morrison - 2008-02-08
     
  • Donal K. Fellows

    Logged In: YES
    user_id=79902
    Originator: NO

    Don't use -Wshadow

     
  • Donal K. Fellows

    • priority: 5 --> 4
    • assigned_to: nobody --> hobbs
     
  • Sean Morrison

    Sean Morrison - 2008-02-21

    Logged In: YES
    user_id=785737
    Originator: YES

    It was never a question of what causes the warnings. I merely provided our list to show which ones we tested and worked on cleaning. The -Wshadow flag is desirable for other reasons hence the provided (trivial) patch that quells them.