------- Comment #5 from noloader at gmail dot com 2010-09-06 06:45 ------- (In reply to comment #4) > In G++ 4.6+ you can do: > int i; > unsigned j; > > template <class T> > void > bar (const T& t) > { > #pragma GCC diagnostic push > #pragma GCC diagnostic ignored "-Wtype-limits" > if (t < 0) > #pragma GCC diagnostic pop > { > i++; > } > } > > void foo (void) > { > bar (i); > bar (j); > } > Thanks Jakub.
All those #pragmas look like MS code. I thought Stallman hated those things (I seem to recall #pragma once being the source of a lot of in-house bickering). Did he get over ruled by committee? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45553