Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes lack leading and trailing underscores #95

Open
PHHargrove opened this issue May 26, 2014 · 0 comments
Open

Attributes lack leading and trailing underscores #95

PHHargrove opened this issue May 26, 2014 · 0 comments

Comments

@PHHargrove
Copy link
Contributor

This problem is distinct from issue #94, but manifests on the same input.

Given the following input:

#ifdef __GNUC__
__attribute__((__format__ (__printf__, 1, 2)))
#endif
static void fatal(const char *s, ...) {
    [...body...]
}

upc2c is producing the following output:

static void fatal(const char *s, ...) __attribute__((format(printf, 1, 2))) {
    [...body...]
}

The issue here is the use of format and printf without the leading and trailing __. This usage is "correct", but the form with the underscores is preferred because it lies in the namespace reserved to the implementation and thus should not be subject to problems if, for instance, printf() or format are names of macros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant