[Bug c/82200] Unhelpful diagnostic for incorrectly ordered attribute and asm on function declaration in system header

2019-05-02 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82200

Eric Gallager  changed:

   What|Removed |Added

 CC||msebor at gcc dot gnu.org

--- Comment #5 from Eric Gallager  ---
I know Martin Sebor has done work on attribute diagnostics; cc-ing him

[Bug c/82200] Unhelpful diagnostic for incorrectly ordered attribute and asm on function declaration in system header

2017-11-01 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82200

Eric Gallager  changed:

   What|Removed |Added

 CC||drikosev at gmail dot com

--- Comment #4 from Eric Gallager  ---
*** Bug 82787 has been marked as a duplicate of this bug. ***

[Bug c/82200] Unhelpful diagnostic for incorrectly ordered attribute and asm on function declaration in system header

2017-09-13 Thread egallager at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82200

Eric Gallager  changed:

   What|Removed |Added

   Keywords||diagnostic
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-09-13
Summary|Failed to use __asm under   |Unhelpful diagnostic for
   |macOS 10.13 |incorrectly ordered
   ||attribute and asm on
   ||function declaration in
   ||system header
 Ever confirmed|0   |1

--- Comment #3 from Eric Gallager  ---
OK, so it looks like what's going on here is that the attribute and the asm are
in the wrong order. Using just 1 of them compiles successfully, as does using
them in the other order:

$ cat 82200.c
void failsyslog(int, const char *, ...) __attribute__((__format__ (__printf__,
2, 3))) __asm("_" "msyslog" "$DARWIN_EXTSN");
void okfmtsyslog(int, const char *, ...) __attribute__((__format__ (__printf__,
2, 3)));
void okasmsyslog(int, const char *, ...) __asm("_" "msyslog" "$DARWIN_EXTSN");
void okbothsyslog(int, const char *, ...) __asm("_" "msyslog" "$DARWIN_EXTSN")
__attribute__((__format__ (__printf__, 2, 3)));
int main() {}
$ /usr/local/bin/gcc -c -Wall -Wextra -pedantic 82200.c
82200.c:1:88: error: expected ‘,’ or ‘;’ before ‘__asm’
 void failsyslog(int, const char *, ...) __attribute__((__format__ (__printf__,
2, 3))) __asm("_" "msyslog" "$DARWIN_EXTSN");
   
^
$

So confirmed that the diagnostic could be more helpful and say something about
the attribute. I guess also the header could be fixincluded or something.