https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82063

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=71905,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=80545,
                   |                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=81650

--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
There are a few outstanding problems here.  The option should be in -Wall but
is apparently enabled by default (this could be related to 80545).  Unsigned
arguments are accepted but the result is silently [mis]interpreted as signed
(ssize_t) which can have surprising effects.  One such effect is that there's
no way to specify sizes in excess of SSIZE_MAX (the handler should either treat
the value as unsigned or it should warn when the values is in excess of
SSIZE_MAX, and ignore the setting).  Suffixes other than KB and KiB are ignored
(looks like because of a typo in the test for "KB").

The suffix handling is only superficially tested so it's not too surprising
there are bugs in it.  It should be tested better and with the bugs fixed the
function should be moved to the option processing infrastructure where other
similar options can make use of it (this is tracked in bug 71905).

That said, I think the UNIT variable is handled correctly.  It's initialized to
1 and only reset to zero when the suffix is not recognized.  The handler
probably should issue a warning in that case.

Jim, since you've spent some time on this already and understand the problems,
please feel to propose a patch.  If you don't get to it I'll see if I can find
the time to fix at least some of these problems in stage 3.

Reply via email to