Re: glibconfig.h.win32.in: MSVC warning pragmas



At 19:42 24.11.01 +0200, Tor Lillqvist wrote:
>2001-11-23  Hans Breuer  <hans breuer org>
>
>	* glibconfig.h.win32.in : added recommended pragma list for
>	msvc again. They are an invaluable help of letting the
>	compiler catch bugs.
>
>I won't object that these pragmas indeed are useful most of the
>time. But is it really GLib's job to dictate for developers working
>with any GLib-using software that various compiler warnings are turned
>on and off in source files that include (indirectly) glibconfig.h?
>
I think so - otherwise I wouldn't have added them again :-)

>It would be OK to have these in config.h.win32.in (and thus only
>affect compilation of GLib itself). 
They are as useful for Gtk+, Pango, Gimp, Dia, ...

so having them only in glib/config.h will IMO defeat the purpose. 

>But what if some GLib-using
>software really needs to be compiled with "truncation from int to
>char" warnings when searching for some elusive bug, for instance. The
>developer working on finding said bug won't be pleased to notice that
>glibconfig.h has turned off those warnings.
>
If this isn't just a theoretical problem I see five possibilties :

a) document the warning to error policy within the glib developer docs 
   and hope that someone will read it. Also document how to reenable
   warnings, because those people who read glib docs will read neither
   the glib source nor the msvc contained docs.
b) remove those offending #pragma warning(disable:xxxx) but leave
   the warnings as errors intact
c) wrap them into an ifdef so users can switch them off if they really
   need to
d) put them into their own header contained in cvs/glib, which gets 
   included in every glib downstream packages I care for by 'force 
   include':
	 -FImsvc_recommended_pragmas.h in every makefile.msc
e) drop them alltogether and let slip through all bugs which are catched
   by them (it appears to me that this was the supposed way before
   I did add them again :)

Obviously one could also copy and paste these in every config.h.win32 
because they are such useful to be spread all over the place ...

Regards,
	Hans

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]