Open sezero opened 7 years ago
According to "Badly punctuated parameter list in #define" blog post, the problem could be fixed by replacing:
#define AllocDosObjectTags(___type, ___tags, ...) \
({_sfdc_vararg _tags[] = { ___tags, __VA_ARGS__ }; AllocDosObjectTagList((___type), (const struct TagItem *) _tags); })
... with:
#define AllocDosObjectTags(___type, ___tags, ARGS...) \
({_sfdc_vararg _tags[] = { ___tags, ##ARGS }; AllocDosObjectTagList((___type), (const struct TagItem *) _tags); })
This could be achieved by modifying function_start in sfdc.
Another quick fix is to pass -Wp,-std=gnu9x
to g++
which makes sure C++ compiler uses "more recent" preprecessor features. As __VA_ARGS__
works with newer C++ standard I'm in favour of not changing sfdc
, but rather supplying default option to the preprocessor when running in C++ mode (-lang-c++
option). However I'd have to reach out to C++ guys to verify if such a change won't break something fundamentally.
EDIT: I could modify -lang-c++ settings with opts->c9x = 1
.
@sezero Any opinion on that topic? I'm leaning towards latter option.
-Wp,-std=gnu9x
(but not -std=gnu9x
alone) does workaround the issue
for me.
Applied your suggested change to my fork as https://github.com/sezero/amigaos-gcc-2.95.3/commit/53b3955284694f7dbe99db4da5e0a8148d7bd4a9
Relevant part of inline/dos.h, around line 157: