tcc failed to warn that the final assignment violated a constraint,
and it just compiled anyways completely ignoring the 'const'.

Attached is the code (19 lines). Can someone please tell me what's
going on here?
gcc caught it and refused to compile it.

Thanks.
#include <stdio.h>
#include <stdlib.h>

struct somestruct{
      int i;
};

main(){
      struct somestruct item;
      const struct somestruct *cssp;

      item.i = 1;  
      cssp = &item;
      printf("lul: %d\n", item.i);
      cssp->i = 0;    /* not permitted - cssp points to const objects */

      printf("lol: %d\n", cssp->i);

      exit(EXIT_SUCCESS);
}


_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to