[clang] [AIX] Detect `#pragma mc_func` (PR #99888)

Qiongsi Wu via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 25 08:54:53 PDT 2024


qiongsiwu wrote:

> this same logic can be applied to almost every pragma we don't support, but we don't want to add special handlers for every pragma we don't support.

> It doesn't seem particularly dangerous to ignore this pragma because ignoring it means no symbol is generated for the synthesized function, so any calls to that symbol will get errors anyway, right?

Yes I agree with both statements. I have not reviewed other pragmas that we do not support, but I think this one is a bit special in that it defines functions (code) that can be executed, and we are aware of use cases where detecting the error at link time is insufficient. Eventually, this error check will be turn on all the time after AIX cleans up the system headers. I agree we should not add checks for arbitrary `pragma`s that we do not support (and probably for each case there is an argument to add such a check), but as stated above, we are aware of use cases that this check adds value. Considering that this check has limited impact on other platforms, we are providing it upstream. 

If the community has strong objections, I will bring this back to the team to discuss a better way going forward. 

https://github.com/llvm/llvm-project/pull/99888


More information about the cfe-commits mailing list