[PATCH 1/4] drm/amdgpu: Treat warning as an error
Rodrigo Siqueira Jordao
rjordrigo at amd.com
Tue Jan 11 13:42:26 UTC 2022
On 2022-01-11 6:00 a.m., Michel Dänzer wrote:
> On 2022-01-11 11:41, Michel Dänzer wrote:
>> On 2022-01-11 00:39, Rodrigo Siqueira wrote:
>>> We have one internal CI that builds our kernel with the -Werror flag; as
>>> a result, when we try to sync our branch with amd-staging-drm-next we
>>> get some failures due to warnings. This commit tries to alleviate this
>>> problem by forcing a warning to be treated as an error.
>>>
>>> Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira at amd.com>
>>> ---
>>> drivers/gpu/drm/amd/amdgpu/Makefile | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile
>>> index 7fedbb725e17..158f427c2f2e 100644
>>> --- a/drivers/gpu/drm/amd/amdgpu/Makefile
>>> +++ b/drivers/gpu/drm/amd/amdgpu/Makefile
>>> @@ -27,6 +27,8 @@ FULL_AMD_PATH=$(srctree)/$(src)/..
>>> DISPLAY_FOLDER_NAME=display
>>> FULL_AMD_DISPLAY_PATH = $(FULL_AMD_PATH)/$(DISPLAY_FOLDER_NAME)
>>>
>>> +subdir-ccflags-y += -Werror
>>
>> The problem with this is that different compilers, or even different versions of the same compiler, can generate different warnings for the same code. So this will definitely result in some people hitting compile failures for no reason other than using a different compiler (version) than the code had been tested with.
>
> A corollary of this is that your internal CI might still hit compile failures due to warnings, if its compiler (version) is sufficiently different from those used by the critical path of maintainers for merging amdgpu changes.
>
> Since that CI cannot prevent merging of changes with warnings, it cannot enable -Werror without risking this.
Hi Michel/Alex,
Those are great points, and I did not think about the different GCC an
config versions; I tried with GCC and Clang, but the version can
definitely become a problem.
Thanks a lot for the explanation; I guess I need to find another way to
handle this issue.
Best Regards
Siqueira
More information about the amd-gfx
mailing list