From: cgd@google.com (Chris Demetriou)
To: reply@codereview.appspotmail.com, dnovillo@google.com,
gcc-patches@gcc.gnu.org
Subject: [google][RFA] add extra text to stack frame warnings (issue4479046)
Date: Thu, 05 May 2011 18:39:00 -0000 [thread overview]
Message-ID: <20110505182734.5CC6A1E819C@cgda.mtv.corp.google.com> (raw)
Diego,
I know this is a truly horrible and broken way to do this, but alternatives
(e.g., NLS) don't really work for us.
bootstrapped without new configuration (x86-64 ubuntu lucid, didn't bother
to run tests), bootstrapped with option (x86-64 ubuntu lucid, with full
tests, no regressions). Manually tested that the resulting warning
looks right, too.
OK for google/main?
chris
---
[gcc/ChangeLog.google-main]
2011-05-05 Chris Demetriou <cgd@google.com>
* doc/install.texi (--with-warn-frame-larger-than-extra-text): New.
* configure.ac (--with-warn-frame-larger-than-extra-text): New.
(WARN_FRAME_LARGER_THAN_EXTRA_TEXT): Define.
* final.c (final_start_function): Use
WARN_FRAME_LARGER_THAN_EXTRA_TEXT.
* configure: Regenerate.
* config.in: Regenerate.
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi (revision 173353)
+++ gcc/doc/install.texi (working copy)
@@ -1707,6 +1707,10 @@
See @option{-canonical-prefixes} or @option{-no-canonical-prefixes} for
more details, including how to override this configuration option when
compiling.
+
+@item --with-warn-frame-larger-than-extra-text=@var{text}
+Append @samp{@var{text}} to frame size warnings generated by
+the @option{-Wframe-larger-than} warning flag.
@end table
@subheading Cross-Compiler-Specific Options
Index: gcc/final.c
===================================================================
--- gcc/final.c (revision 173353)
+++ gcc/final.c (working copy)
@@ -1576,9 +1576,13 @@
if (warn_frame_larger_than
&& get_frame_size () > frame_larger_than_size)
{
- /* Issue a warning */
+ /* Issue a warning. (WARN_FRAME_LARGER_THAN_EXTRA_TEXT is
+ provided by configuration. The way extra text is added
+ here may prevent localization from working properly.
+ It's totally broken.) */
warning (OPT_Wframe_larger_than_,
- "the frame size of %wd bytes is larger than %wd bytes",
+ "the frame size of %wd bytes is larger than %wd bytes"
+ WARN_FRAME_LARGER_THAN_EXTRA_TEXT,
get_frame_size (), frame_larger_than_size);
}
Index: gcc/configure.ac
===================================================================
--- gcc/configure.ac (revision 173353)
+++ gcc/configure.ac (working copy)
@@ -4951,6 +4951,20 @@
fi
+warn_frame_larger_than_extra_text=
+AC_ARG_WITH(warn-frame-larger-than-extra-text,
+[ --with-warn-frame-larger-than-extra-text=TEXT
+ specifies extra text for frame size warnings],
+[case "${withval}" in
+yes) AC_MSG_ERROR(bad value ${withval} given for frame size warning text) ;;
+no) ;;
+*) warn_frame_larger_than_extra_text="$withval" ;;
+esac])
+AC_DEFINE_UNQUOTED(WARN_FRAME_LARGER_THAN_EXTRA_TEXT,
+ "$warn_frame_larger_than_extra_text",
+ [Define to be extra text for frame size warnings.])
+
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)
--
This patch is available for review at http://codereview.appspot.com/4479046
next reply other threads:[~2011-05-05 18:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 18:39 Chris Demetriou [this message]
2011-05-05 19:09 ` Diego Novillo
2011-05-05 19:23 ` Andrew Pinski
2011-05-06 8:53 ` Chris Demetriou
2011-05-06 17:09 ` Andrew Pinski
[not found] ` <BANLkTimMdjRDwC7Z-xsAbV4GdJn8gP+QgA@mail.gmail.com>
2011-06-10 8:35 ` Chris Demetriou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110505182734.5CC6A1E819C@cgda.mtv.corp.google.com \
--to=cgd@google.com \
--cc=dnovillo@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=reply@codereview.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).