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

Chris Lattner clattner at apple.com
Mon Apr 13 23:50:15 PDT 2009


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/20090413/53cedd2a/attachment.html>


More information about the cfe-dev mailing list