g++ -Wno-return-type won't work for me

Jason Smigiel jsmigiel@pbl.ca
Tue Apr 24 10:18:00 GMT 2001


I want to suppress errors/warnings about functions declared with
no return type. (as in the example at the bottom of this message.)

The gcc docs say that this is possible with the -Wno-return-type arg.
(see:  http://gcc.gnu.org/onlinedocs/gcc-2.95.3/gcc_2.html#SEC7 )

I compile the program below with this command line:
    g++  -Wno-return-type -fpermissive no_ret.C

But I still get the warning message.
(note -w gets rid of it alright, but then I'll get no warnings at all)

Am I missing something?

Thanks for any help,
Jason
    
---- no_ret.C ---
#include <strstream.h>

my_func(void) {
    cout << "Hello" << endl;
}

void main (void) {
    my_func();
}



More information about the Gcc-help mailing list