Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

7586 remove #ifdef __lint hack from dmu.h #255

Closed

Conversation

dankimmel
Copy link

@dankimmel dankimmel commented Nov 29, 2016

Reviewed by: Matthew Ahrens mahrens@delphix.com
Reviewed by: Pavel Zakharov pavel.zakharov@delphix.com

The #ifdef __lint in dmu.h is ugly, and it would be nice not to
duplicate it if we add other inline functions into header files in ZFS,
especially since it is difficult to make any other solution work across
all compilation targets. We should switch to disabling the lint flags
that are failing instead.

Upstream bugs: DLPX-44715

@dankimmel
Copy link
Author

@zettabot go

@@ -564,12 +564,7 @@ typedef struct dmu_buf_user {
* NOTE: This function should only be called once on a given dmu_buf_user_t.
* To allow enforcement of this, dbu must already be zeroed on entry.
*/
#ifdef __lint
/* Very ugly, but it beats issuing suppression directives in many Makefiles. */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really "better"? You're trading away the ability to notice unused statics, which seems to me a high price to pay to get rid of an #ifdef __lint.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gcc will detect unused statics correctly but not get tripped up by inline functions. So it's true that lint won't notice, but as long a we aren't gagging unused functions, it should be fine.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's only lint that won't notice unused statics, then OK.

@dankimmel dankimmel force-pushed the openzfs.7586-ifdef__lint-hack branch 2 times, most recently from 7cc3603 to 81f06b1 Compare December 2, 2016 17:01
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>

The #ifdef __lint in dmu.h is ugly, and it would be nice not to
duplicate it if we add other inline functions into header files in ZFS,
especially since it is difficult to make any other solution work across
all compilation targets. We should switch to disabling the lint flags
that are failing instead.
@dankimmel dankimmel force-pushed the openzfs.7586-ifdef__lint-hack branch from 81f06b1 to 34728f0 Compare December 2, 2016 19:24
@ahrens ahrens closed this in 9728822 Dec 2, 2016
@dankimmel dankimmel deleted the openzfs.7586-ifdef__lint-hack branch March 31, 2017 22:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants