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

JREnumDeclare causing compiler "Unused variable" warnings. #3

Closed
mralexgray opened this issue Apr 13, 2013 · 3 comments
Closed

JREnumDeclare causing compiler "Unused variable" warnings. #3

mralexgray opened this issue Apr 13, 2013 · 3 comments

Comments

@mralexgray
Copy link
Contributor

… Unused variable '_AZQuadrant_constants_string'

i tried wrapping the whole macro in

`#pragma clang diagnostic push

pragma clang diagnostic ignored "-Wunused-value"

"JREnumDeclare…"

pragma clang diagnostic pop`

or just wrapping the

static NSString *_##ENUM_TYPENAME##_constants_string = @"" #ENUM_CONSTANTS;

line, but didn't help. actually, tried wrapping the single line with the weird `_Pragma( blah blah blah) format - that "supposedly" works with Macros.

I finally tied to just convert the whole thing to a straight function… but i can't figure out what the hell ##ByValue(); etc are doing.

any advice?

@rentzsch
Copy link
Owner

Yeah I got a repro here. I'm pretty sure this didn't used to trigger a warning.

_##ENUM_TYPENAME##_constants_string is just a way to pass the enum string from where it was declared (usually a .h file) to where it can be implemented (usually in a .m file).

@rentzsch
Copy link
Owner

Oh I forgot to mention: I discovered a couple of clang versions back _Pragma("clang diagnostic ignored \"-Wunused-value\"") stopped working. I suspect a regression, and I'm surprised it's not fixed yet.

rentzsch added a commit that referenced this issue Apr 25, 2013
…ang diagnostic ignored \"-Wunused-value\"")` to suppress "Unused variable" warnings as pointed out in #3.

Pretty sure these warnings didn't show up with the version of Xcode/clang that I wrote JREnum with.

Anyway, this is kinda academic since a couple of versions back `_Pragma("clang diagnostic ignored \"-Wunused-value\"")` stopped working. I'm putting this in here anyway hoping it starts working again in a future version of clang.
@rentzsch
Copy link
Owner

Oops, forgot to mark this one closed. It was fixed in 4398e3f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants