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

Silence an unused variable warning from Clang #23810

Merged
merged 1 commit into from
Sep 22, 2017
Merged

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented Sep 21, 2017

Part of my never-ending quest to silence Clang warnings emitted when building Julia.

@yuyichao
Copy link
Contributor

All macros should start with JL_. _ prefix is actually reserved names.

I think we are just using (void) directly. It's a pretty standard C trick and is actually shorter to type than JL_UNUSED().....

@ararslan
Copy link
Member Author

Okay, so rather than introducing a macro for this, I should change _UNUSED(truncret) to (void)truncret?

@yuyichao
Copy link
Contributor

Yes, I think that's good enough. C macros are mainly useful when there's compiler dependent definitions or if the definition is actually complicated. unused is neither. It also conflicts with a potential useful macro that uses the unused attribute to mark unused functions so I was especially avoiding introducing it as a void cast.

@ararslan
Copy link
Member Author

Okay, I'll make that change. Thanks!

@ararslan ararslan changed the title Introduce an _UNUSED C macro to "use" unused variables Silence an unused variable warning from Clang Sep 21, 2017
@ararslan ararslan merged commit 81308aa into master Sep 22, 2017
@ararslan ararslan deleted the aa/clang-warn branch September 22, 2017 05:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants