From: SourceForge.net <no...@so...> - 2012-03-01 15:12:39
|
Bugs item #3495989, was opened at 2012-03-01 06:37 Message generated for change (Comment added) made by spth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3495989&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C-Front End Group: None >Status: Open >Resolution: None Priority: 5 Private: No Submitted By: Phil () >Assigned to: Nobody/Anonymous (nobody) Summary: Incorrect handling of arithemetic operations on void pointer Initial Comment: The following code compiles withou any warnings using SDCC : mcs51 3.1.0 #7066 (Nov 28 2011) (Mac OS X x86_64): static void *ptr; static unsigned char n; void main(void) { ptr += n; } However, the generated code does nothing: ; testcase2.c:7: ptr += n; ret ---------------------------------------------------------------------- >Comment By: Philipp Klaus Krause (spth) Date: 2012-03-01 07:12 Message: It seems I was partially wrong. While sdcc's current behaviour is correct for C89/90, C95 and C99, it is not for C11. We should make it an error for C11, which does not allow pointers to incomplete object types as addition operands. Philipp ---------------------------------------------------------------------- Comment By: Philipp Klaus Krause (spth) Date: 2012-03-01 07:01 Message: Maybe we should warn here, since you seem to be at least the second person running into this and not liking what sdcc does. Nevetheless, AFAIK, this is standard-compliant bahaviour. Philipp ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3495989&group_id=599 |