[Bug c/51391] Differences between setting Winline in command-line and through pragma GCC diagnostic
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Dec 3 11:05:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51391
--- Comment #14 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-12-03 11:04:48 UTC ---
This patch fixes the issue:
Index: gcc/opts.c
===================================================================
--- gcc/opts.c (revision 180166)
+++ gcc/opts.c (working copy)
@@ -1423,10 +1423,20 @@ common_handle_option (struct gcc_options
enable_warning_as_error (arg, value, lang_mask, handlers,
opts, opts_set, loc, dc);
break;
+ case OPT_Winline:
+ if (opts->x_optimize == 0)
+ {
+ /* Inlining does not work if not optimizing,
+ so force it not to be done. */
+ opts->x_warn_inline = 0;
+ opts->x_flag_no_inline = 1;
+ }
+ break;
+
case OPT_Wlarger_than_:
opts->x_larger_than_size = value;
opts->x_warn_larger_than = value != -1;
break;
Feel free to take it and prepare it for submission:
http://gcc.gnu.org/contribute.html#patches
More information about the Gcc-bugs
mailing list