-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 all warnings when building with GCC on Linux #44350
Conversation
In https://build.julialang.org/#/builders/41/builds/3390/steps/7/logs/stdio I see another warning which I didn't get locally
Lines 3302 to 3306 in a2e4226
Line 3339 in a2e4226
only if ismodifyfield is true, which is the same condition when it's set. I wonder if newer GCC got smarter?
Edit: warning fixed in the following commit. |
Instead on aarch64 we get plenty of warnings like
which come from libunwind... I guess at the moment we can do little about them apart from disabling the corresponding warnings |
libunwind is usually pretty good about taking patches. Looks like some platforms put |
Summary of the compiler warnings:
Again, what about enabling |
This makes sense to me! And then we can add other platforms one by one as we fix then. @staticfloat @vtjnash Are you cool with this idea? If so, I'll give @giordano directions to the two places that he'll need to implement this change. |
Bump 🙂 |
Yeah, I'm cool with this. I say merge this now, and then add |
Does anyone want to review the changes? I think they should all be mostly uncontroversial, the only one I'm not entirely sure is |
jl_safe_printf("%ld Major collection: estimate freed = %ld | ||
live = %ldm new interval = %ldm time = %ldms\n", | ||
jl_safe_printf("%ld Major collection: estimate freed = %ld\n" | ||
"live = %ldm new interval = %ldm time = %ldms\n", | ||
end - start, freed, live/1024/1024, | ||
interval/1024/1024, pause/1000000 ); | ||
else | ||
jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm | ||
new interval = %ldm time = %ldms\n", | ||
jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm\n" | ||
"new interval = %ldm time = %ldms\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not even sure how this compiled, but I presume this was the intention of these printfs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it intended to have newlines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chflood how where these lines intended to be printed? A standard printf
wouldn't even compile with the previous syntax. I'm happy to fix it according to the original intention.
Can this be made conditional for use on the CI systems only? Adding |
I don't think anyone suggested to make |
Ok, that's good. I had started reading from where GitHub told me the new messages were and had forgotten the prior mentions of it in the thread since it had been so long 😆. |
The former causes a compiler warning with Clang about it being a language extension, which then causes an error if building with `-Werror`.
58f05e3
to
e3d8a33
Compare
The problem with the original code was that it didn't print the right
numbers on 32 bit Julia. The problem with the current code is that it gets
a warning on 64 bit Julia. I will take a look.
On Thu, Mar 31, 2022 at 2:25 PM Christine Flood <
***@***.***> wrote:
… This runs when you uncomment #define GC_TIME in src/options.h
On Thu, Mar 31, 2022 at 2:22 PM Mosè Giordano ***@***.***>
wrote:
> ***@***.**** commented on this pull request.
> ------------------------------
>
> In src/gc-debug.c
> <#44350 (comment)>:
>
> > - jl_safe_printf("%ld Major collection: estimate freed = %ld
> - live = %ldm new interval = %ldm time = %ldms\n",
> + jl_safe_printf("%ld Major collection: estimate freed = %ld\n"
> + "live = %ldm new interval = %ldm time = %ldms\n",
> end - start, freed, live/1024/1024,
> interval/1024/1024, pause/1000000 );
> else
> - jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm
> - new interval = %ldm time = %ldms\n",
> + jl_safe_printf("%ld Minor collection: estimate freed = %ld live = %ldm\n"
> + "new interval = %ldm time = %ldms\n",
>
> @chflood <https://github.com/chflood> how where these lines intended to
> be printed? A standard printf wouldn't even compile with the previous
> syntax. I'm happy to fix it according to the original intention.
>
> —
> Reply to this email directly, view it on GitHub
> <#44350 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AE3CLBFIUH7RPK2TBBPFU5LVCXUPJANCNFSM5PLSGJYA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
* Silence all warnings when building with GCC on Linux * Replace `#warning` with `#pragma message` The former causes a compiler warning with Clang about it being a language extension, which then causes an error if building with `-Werror`. * Silence warning about unused variable when doing a non-debug build * Initialise another variable which can be detected as uninitialised * Fix more warnings introduced by recent changes
With this PR I can do a clean build from scratch (at least after
git clean -fxd
) withmake CFLAGS=-Werror CXXFLAGS=-Werror
when using GCC 11.1.0 on Linux. Clang is way more picky.@staticfloat @vtjnash does it make sense to enable
-Werror
in CI at least for the platforms where we use GCC? Now that there is a (partially) clean state it'd be good to not introduce new warnings.