On Wed, 2015-11-04 at 10:40 -0800, Othman, Ossama wrote: > Hi Erich, > > On Wed, Nov 4, 2015 at 10:35 AM, Keane, Erich <erich.keane at intel.com> > wrote: > > On a related note, why are attempting to include > <stdassert.h>? > > AFAIK, that's not a standard header. Isn't the C11 > static_assert() > > macro is define in <assert.h>? > > > > > > Furthermore, IoTivity shouldn't be checking the value of the > > __STDC_VERSION__ preprocessor symbol. It is an internal > > implementation detail. Checking if the non-standard > _ISOC11_SOURCE > > preprocessor symbol is defined would be cleaner (see the > > feature_test_macros(7) man page). > > > __STDC_VERSION__ was added in the C95 ISO extension, which is > included > in C99. > > > Excellent. Thanks for the clarification! The double underscores > raised a red flag for me. > > > What about <stdassert.h>? It doesn't appear to be standard. > > It isn't, but we're compiling with C99, so we don't have access to the C11 static_assert. I don't remember where I grabbed it, but apparently gcc was providing it in stdassert.h anyway, which I mistakenly thought was standard-compliant. The include should likely be changed to just assert.h, since the __STDC_VERSION__ test was for C11.
There IS an alternative that isn't as nice error message wise, which I suspect will be hit for most situations. > > Thanks, > -Ossama > > > P.S.: Thanks for understanding my post despite my grammar typos. :) :) > > > >
