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

Removed mentions of Wdeclaration-after-statement now that C99 is requ… #447

Merged
merged 2 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion config/gnu-warnings/error-general
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# circumstances, so ask the compiler to treat them as errors:
#
-Werror=bad-function-cast
-Werror=declaration-after-statement
-Werror=implicit-function-declaration
-Werror=missing-declarations
-Werror=missing-prototypes
Expand Down
1 change: 0 additions & 1 deletion config/gnu-warnings/noerror-general
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# circumstances, so ask the compiler to treat them as errors:
#
-Wbad-function-cast
-Wdeclaration-after-statement
Copy link
Contributor

@byrnHDF byrnHDF Apr 20, 2021

Choose a reason for hiding this comment

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

Should this warning also be taken out of error-general file or downgraded to just a warning in that file?
Also, line 2 and 3 of this file should be reworded. Maybe something like:

HDF5 code should not trigger the following warnings, they are identified
as candidates for the compiler to treat them as errors:

Copy link
Contributor

Choose a reason for hiding this comment

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

There should not be a noerror-general file or any other noerror- file.

The error- and noerror- files are identical under a simple search and replace that is in config/gnu-flags: if PROMOTE_ERRORS is set to no then every occurrence of -Werror= is transformed to a warning (-W). Looks like the CMake files can do essentially the same thing.

Copy link
Contributor

Choose a reason for hiding this comment

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

"Silence is golden." Declarations after statements are allowed, so let's just delete -Wdeclaration-after-statement everywhere it occurs.

Copy link
Contributor

Choose a reason for hiding this comment

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

There should not be a noerror-general file or any other noerror- file.

The error- and noerror- files are identical under a simple search and replace that is in config/gnu-flags: if PROMOTE_ERRORS is set to no then every occurrence of -Werror= is transformed to a warning (-W). Looks like the CMake files can do essentially the same thing.

But wouldn't that promote ALL warnings? I thought the error-general file was intended to only promote those that should pass?

Copy link
Contributor

Choose a reason for hiding this comment

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

"Silence is golden." Declarations after statements are allowed, so let's just delete -Wdeclaration-after-statement everywhere it occurs.

I didn't think we came to a conclusion on this. We would need a way to identify (maybe a ./bin/check_declaration script?) what was valid vs not wanted behavior.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know what you mean, "promote ALL warnings." Not all warnings are in the error- files. The error- files are supposed to contain those warnings that should ordinarily stop the library compilation cold.

Copy link
Contributor

Choose a reason for hiding this comment

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

If there is an objectionable declaration after statement, then the place to flag that is during PR review.

Copy link
Contributor

Choose a reason for hiding this comment

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

If there is an objectionable declaration after statement, then the place to flag that is during PR review.

I'd rather avoid many "noisy" PRs and just keep the error

Copy link
Contributor

Choose a reason for hiding this comment

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

From a quick review of the platforms being reported in DT, it looks like no configuration is complaining about for loop declarations. This is looking at code that I know have these for loop declarations (blosc filter). Therefore I don't think we need to remove this warning at this time and still allow for loop declarations.
Let's start by implementing for loop declarations and then in a few months take the next step if we all agree?

-Wimplicit-function-declaration
-Wmissing-declarations
-Wmissing-prototypes
Expand Down
2 changes: 0 additions & 2 deletions release_docs/INSTALL_Warnings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ Autotools UNIX warnings added to H5_CFLAGS
-Wcast-align
-Wcast-qual
-Wconversion
-Wdeclaration-after-statement
-Wdisabled-optimization
-Wfloat-equal
-Wformat=2
Expand Down Expand Up @@ -291,7 +290,6 @@ IF GNU GCC
-Wcast-align
-Wcast-qual
-Wconversion
-Wdeclaration-after-statement
-Wdisabled-optimization
-Wfloat-equal
-Wformat=2
Expand Down