apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Adding gcc attributes to function declarations
Date Sun, 15 May 2011 09:40:18 GMT

I think it would be a good idea to add some more gcc attribute annotations 
to our header to mark parameters that must not be NULL, etc. We already 
have some of these for format string.

In order to not break other compilers, I thought to just include

#if !defined(__GNUC__)
#define __attribute__(x)

at the top. Or would it be better to have something like

#if defined(__GNUC__)
#define APR_NONNULL(x) __attribute__((nonnull(x)))
#define APR_NONNULL(x)

for every attribute? Would these macros be a new API that needs to wait 
for 1.5.x?


View raw message