gcc not warning on all occurences of operations with undefined results?
John Love-Jensen
eljay@adobe.com
Tue Nov 15 16:03:00 GMT 2005
Hi Daniel,
> IMHO, these lines also infringe upon the above mentioned rule or did I miss
> something important?
The compiler *CAN* warn about those kinds of infringements.
The compiler does *NOT* *HAVE* to warn about those kinds of infringements.
GCC 3.3.5 detects the simple case. It does not (I presume) detect the
indirect case that you provided.
In some situations it may be very hard to detect the indirect case during
compile time, and it could be very expensive to check for it at run time.
HTH,
--Eljay
More information about the Gcc-help
mailing list