[cfe-dev] Questions about ctor/dtor attribute related diagnostics

Xiangling Liao via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 30 14:01:05 PDT 2020


I noticed that there are some diagnostics discrepancies between clang and
gcc related to `__attribute__((constructor(n)))` and

It seems priorities >65535 and <0 on ctor/dtor functions are ignored and
are set back to default 65535 in clang and Clang only gives an error when >
32-bit unsigned value specified.

g++ gives an error for any values <0 and >65535.

I am wondering should we let Clang's diagnostics match g++ to make things
clearer to the user? Or why Clang emits an error for *>32-bit unsigned
value* only?

Thank you,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20201030/d7cb5ddc/attachment.html>

More information about the cfe-dev mailing list