This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: two warnings useful for monitoring stack usage
- To: David Whedon <dwhedon at gordian dot com>
- Subject: Re: [PATCH]: two warnings useful for monitoring stack usage
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Thu, 25 Jan 2001 21:41:01 +0000
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20010125125414.G42308@ogun.gordian.com>
David Whedon wrote:-
> + else if (!strncmp (p, "-Wlarge-frame-size=", 19)){
> + const char *argstart = &p[19];
> + char *endptr;
> + warn_large_frame_size = strtol(argstart, &endptr, 10);
> + if (endptr==argstart){
> + error ("Invalid frame size `%s'", argstart);
> + }
> + else
> + warn_large_frame = 1;
This logic, like some I recently fixed for -Wlarger-than- (but not yet
received approval for) is not robust. A second incorrect switch can
hijack the correctness of an earlier switch. Can I suggest you update
warn_large_frame unconditionally (and similarly for the other one)?
Neil.