This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/5969: When function is declared func(unsigned char v), v isn't truncated


Synopsis: When function is declared func(unsigned char v), v isn't truncated

Responsible-Changed-From-To: unassigned->dberlin
Responsible-Changed-By: dberlin
Responsible-Changed-When: Sat Mar 16 15:01:56 2002
Responsible-Changed-Why:
    Me
State-Changed-From-To: open->feedback
State-Changed-By: dberlin
State-Changed-When: Sat Mar 16 15:01:56 2002
State-Changed-Why:
    You have implicitly declared tst to take an int by using it before it's defined.
    Because it is inlined into main at -O2, and at that point it thinks it takes an int, it never performs the truncation.
    
    Any code after the tst function is defined to take an unsigned char will do the truncation.
    
    The problem is the code, not the compiler, AFAIK.
    The title of the bug report is misleading, you haven't declared func(unsigned char v), if you did, the problem would go away.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5969


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]