From: Ibrahim T. <it...@ar...> - 2005-06-29 09:55:54
|
Hello everybody, Please excuse my ignorance in the netickette and use of SF and the naviserver project - and please bear with me - I'm still learning. To Zoran's request (motivated by myself): Since NS_GNUC_NONNULL is not used anywhere else but in nscheck.h itself and only with GNUC, it suffices to remove it from the non-GNUC part to make it compilable for Windows. Is it OK with you if I do so? Greetings, Ibrahim Zoran Vasiljevic wrote: > Hi frieds, > > There seems to be a problem with NS_GNUC_NONNULL macro definition > when compiling the code on Windows. This is how/where this beast > is defined: > > #if __GNUC_PREREQ(3,3) > # define NS_GNUC_NONNULL(...) __attribute__((__nonnull__(__VA_ARGS__))) > # define NS_GNUC_WARN_UNUSED_RESULT __attribute__ > ((__warn_unused_result__)) > # define NS_GNUC_MAYALIAS __attribute__((__may_alias__)) > #else > # define NS_GNUC_NONNULL(...) > # define NS_GNUC_WARN_UNUSED_RESULT > # define NS_GNUC_MAYALIAS > #endif > > Unfortunately, the > > # define NS_GNUC_NONNULL(...) > > will not be accepted by the Microsoft compilers since it is > a varargs macro. They do not support varargs macros. Well. > > Now, idea is to just scrap the NS_GNUC_NONNULL entirely > when compiling with non-gcc compilers. Why? Because this > macro is really only used IF gcc, and, as far as I can > see it is used only here: > > #if __GNUC_PREREQ(2,7) > # define NS_GNUC_UNUSED __attribute__((__unused__)) > # define NS_GNUC_NORETURN __attribute__((__noreturn__)) > # define NS_GNUC_PRINTF(m, n) __attribute__((__format__ (__printf__, m, > n))) NS_GNUC_NONNULL(m) > # define NS_GNUC_SCANF(m, n) __attribute__((__format__ (__scanf__, m, > n))) NS_GNUC_NONNULL(m) > #else > # define NS_GNUC_UNUSED > # define NS_GNUC_NORETURN > # define NS_GNUC_PRINTF(fmtarg, firstvararg) > # define NS_GNUC_SCANF(fmtarg, firstvararg) > #endif > > Are there any objections to remove the NS_GNUC_NONNULL? > Are there any better ideas? > > Cheers > Zoran |