[C++ Patch / RFC] PR 33067

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Oct 10 17:57:00 GMT 2011


On Mon, Oct 10, 2011 at 12:16 PM, Paolo Carlini
<paolo.carlini@oracle.com> wrote:
> On 10/10/2011 07:13 PM, Gabriel Dos Reis wrote:
>>
>> on this particular input, '6' looks OK. However, the question is why '6'?
>> Why can't we retain the original number spelling from the source code and
>> use that instead?
>
> Yes, that would be 49152, no? It's quite a bit of work, I don't think
> somebody will be able to do that in time for 4.7.0, right? I I were a user
> of gcc, I would not be suprised to see 6 used, which after all it's the
> historical printf default, I would find it much better anyway than the
> current behavior. But I don't have a strong opinion, I already unassigned
> myself from the PR, fwiw.

I bet most C++ programers don't know what printf default is :-)

In any case that is a compiler implementation detail that has no bearing
with the input program.

A GCC user not interested in numerics probably won't care.
However, I do not think that extends to people who do care about numerics
and have literals in their program.  If GCC displays an error message
with literals truncated, it is not at clear to the user that GCC is
behaving correctly:
for one thing, the error might be mysterious and hard to understand,
now the compiler
is indicating that apparently it does not even parse and understand
correctly his or
her numbers.  How if you have several numbers like that that differs
only on the 10th
digit?  If the user is using an IDE that pattern match the output on
the source code, it
would be even more confusing (as it is now.)


>
> Paolo.
>



More information about the Gcc-patches mailing list