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

attribute init_priority() should trigger warning on OS X #15363

Closed
ilg-ul mannequin opened this issue Jan 18, 2013 · 3 comments
Closed

attribute init_priority() should trigger warning on OS X #15363

ilg-ul mannequin opened this issue Jan 18, 2013 · 3 comments
Labels
bugzilla Issues migrated from bugzilla c++ wontfix Issue is real, but we can't or won't fix it. Not invalid

Comments

@ilg-ul
Copy link
Mannequin

ilg-ul mannequin commented Jan 18, 2013

Bugzilla Link 14991
Resolution WONTFIX
Resolved on Jan 22, 2013 13:28
Version 3.1
OS MacOS X
CC @asl,@DougGregor

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

@asl
Copy link
Collaborator

asl commented Jan 18, 2013

These attributes are supported on Apple platforms. They just work within the single module.

@ilg-ul
Copy link
Mannequin Author

ilg-ul mannequin commented Jan 18, 2013

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.

@DougGregor
Copy link
Contributor

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 llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
@Quuxplusone Quuxplusone added the wontfix Issue is real, but we can't or won't fix it. Not invalid label Jan 20, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++ wontfix Issue is real, but we can't or won't fix it. Not invalid
Projects
None yet
Development

No branches or pull requests

3 participants