You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS.cpp:16:57: error: constructor priorities are not supported
OS.cpp:35:59: error: 'init_priority' attribute is not supported on this platform
I think that clang should also trigger warnings, to notify the user that those attributes, although properly processed within the compilation unit, will be silently ignored by the Apple linker.
Liviu
The text was updated successfully, but these errors were encountered:
Yes, I already mentioned this, but on GNU/Linux they work at the entire application level, and it would be nice to warn users that on OS X things are different, to avoid discovering it in the hard way.
It is more like a courtesy issue than a real bug, but such small details differentiate great programs from common ones.
This kind of warning doesn't belong in Clang. We can't warn about even a reasonable number of system-specific differences, so Clang would never be useful as a porting tool for such issues. So (at best) we'd end up with some set of warnings that isn't enough to be useful for someone porting, but generates a lot of noise for someone who has already done the porting effort. Warnings that have such a high false-positive rate (say, by warning about every init_priority attribute on the Mac) don't belong in the compiler.
llvmbot
transferred this issue from llvm/llvm-bugzilla-archive
Dec 3, 2021
Extended Description
After several tests I discovered that the standard Apple linker does not support reordering of constructors.
GCC has a configuration definition
#define SUPPORTS_INIT_PRIORITY 0
that triggers errors when attributes like
attribute((constructor(NNN)))
attribute ((init_priority (NNN)))
are used:
OS.cpp:16:57: error: constructor priorities are not supported
OS.cpp:35:59: error: 'init_priority' attribute is not supported on this platform
I think that clang should also trigger warnings, to notify the user that those attributes, although properly processed within the compilation unit, will be silently ignored by the Apple linker.
Liviu
The text was updated successfully, but these errors were encountered: