[Cryptography] GCC bug 30475 (was Re: bounded pointers in C)

Peter Gutmann pgut001 at cs.auckland.ac.nz
Fri Apr 25 04:58:32 EDT 2014


Stephan Neuhaus <stephan.neuhaus at tik.ee.ethz.ch> writes:

>#if sizeof(ptrdiff_t) == 4
>#  define PTRDIFF_T_MAX INT32_MAX
>#elif sizeof(ptrdiff_t) == 8
>#  define PTRDIFF_T_MAX INT64_MAX
>#else
>#  error Your ptrdiff_t has a weird size
>#endif
>
>I look at this code and am uneasy. It isn't portable,

It's not even functional (unfortunately) since sizeof() isn't evaluated by the
preprocessor.

Peter.


More information about the cryptography mailing list