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

#pragma warning #859

Open
deathscore13 opened this issue Nov 29, 2022 · 5 comments
Open

#pragma warning #859

deathscore13 opened this issue Nov 29, 2022 · 5 comments
Labels
compiler Problems with the compiler parsing source code. enhancement

Comments

@deathscore13
Copy link

I make include with macros that use an overload (which oddly enough in SP works fine) which results in a 201 warning, so I suggest adding a #pragma warning like in msvc
https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170

@sirdigbot
Copy link

A code example demonstrating what you mean might help

@deathscore13
Copy link
Author

A code example demonstrating what you mean might help

At the moment I am using different names:
https://github.com/deathscore13/Macros/blob/9da6f5a2cb62f2f5a898a89735b166fbf6f4ff21/macros.inc#L173-L175

But after I noticed the possibility of overloading, I want to change it to one name, which will differ only in the number of parameters

@peace-maker peace-maker transferred this issue from alliedmodders/sourcemod Nov 30, 2022
@peace-maker peace-maker added enhancement compiler Problems with the compiler parsing source code. labels Dec 6, 2022
@sirdigbot
Copy link

sirdigbot commented Dec 12, 2022

I don't think macros are getting any additional support--bail would remove them given the chance. I'm not sure overloaded macros are supposed to exist.

I also can't think of any other use case where suppressing warnings is a good idea for SP. Usually its a strong indicator of problems in the code unlike in C/C++ where it's not uncommon to run into warnings that you just have to live with because the codebase is built around them.

@deathscore13
Copy link
Author

I don't think macros are getting any additional support--bail would remove them given the chance. I'm not sure overloaded macros are supposed to exist.

I also can't think of any other use case where suppressing warnings is a good idea for SP. Usually its a strong indicator of problems in the code unlike in C/C++ where it's not uncommon to run into warnings that you just have to live with because the codebase is built around them.

Yes, you seem to be right. I recently tried to make 3 macros with the same name, and for some reason it was destroyed, although with 2 macros with the same name everything works fine. It was very strange. Tested on spider.limetech.org

@dvander
Copy link
Member

dvander commented Jul 3, 2023

Can you show an example of what you're looking for here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Problems with the compiler parsing source code. enhancement
Projects
None yet
Development

No branches or pull requests

4 participants