[cfe-dev] invalid Assert in Lex/LiteralSupport.cpp?

Sanjiv.Gupta at microchip.com Sanjiv.Gupta at microchip.com
Tue Apr 14 07:43:38 PDT 2009


Yes, and that change works too.

- Sanjiv



-----Original Message-----
From: Chris Lattner [mailto:clattner at apple.com]
Sent: Tue 4/14/2009 12:20 PM
To: Sanjiv Kumar Gupta - I00171
Cc: cfe-dev at cs.uiuc.edu
Subject: Re: [cfe-dev] invalid Assert in Lex/LiteralSupport.cpp?
 
Have you audited the code to ensure it will behave correctly with  
those assumptions?

-Chris

On Apr 13, 2009, at 11:26 PM, Sanjiv.Gupta at microchip.com wrote:

> CharLiteralParser::CharLiteralParser(const char *begin, const char  
> *end,
>                                      SourceLocation Loc,  
> Preprocessor &PP) {
>   // At this point we know that the character matches the regex  
> "L?'.*'".
>
>   ..
>
>   // FIXME: This assumes that 'int' is 32-bits in overflow  
> calculation, and the
>   // size of "value".
>   assert(PP.getTargetInfo().getIntWidth() == 32 &&
>          "Assumes sizeof(int) == 4 for now");
>
> For PIC16, "int" is 16.
> Should this assert be rather
>
> assert(PP.getTargetInfo().getIntWidth() <= 32 &&
>          "Assumes sizeof(int) <= 4 for now");
>
>
> - Sanjiv
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090414/e339394e/attachment.html>


More information about the cfe-dev mailing list