[PATCH 1/2] selftests: ublk: kublk: build with -Werror

Uday Shankar posted 2 patches 9 months, 3 weeks ago
[PATCH 1/2] selftests: ublk: kublk: build with -Werror
Posted by Uday Shankar 9 months, 3 weeks ago
Heeding compiler warnings is generally a good idea, and is easy to do
for kublk since there is not much source code. Turn warnings into errors
so that anyone making changes is forced to heed them.

Signed-off-by: Uday Shankar <ushankar@purestorage.com>
---
 tools/testing/selftests/ublk/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftests/ublk/Makefile
index ec4624a283bce2ebeed80509be6573c1b7a3623d..57e580253a68bc497b4292d07ab94d21f4feafdd 100644
--- a/tools/testing/selftests/ublk/Makefile
+++ b/tools/testing/selftests/ublk/Makefile
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 
-CFLAGS += -O3 -Wl,-no-as-needed -Wall -I $(top_srcdir)
+CFLAGS += -O3 -Wl,-no-as-needed -Wall -Werror -I $(top_srcdir)
 LDLIBS += -lpthread -lm -luring
 
 TEST_PROGS := test_generic_01.sh

-- 
2.34.1
Re: [PATCH 1/2] selftests: ublk: kublk: build with -Werror
Posted by Jens Axboe 9 months, 3 weeks ago
On 4/23/25 3:29 PM, Uday Shankar wrote:
> Heeding compiler warnings is generally a good idea, and is easy to do
> for kublk since there is not much source code. Turn warnings into errors
> so that anyone making changes is forced to heed them.

Honestly not a fan of this, it tends to cause random warnings on
different compilers, and then just causing trouble for people
rather than being useful. If you think it's a good idea, make
it follow CONFIG_WERROR at least, don't make it unconditional.

-- 
Jens Axboe
Re: [PATCH 1/2] selftests: ublk: kublk: build with -Werror
Posted by Ming Lei 9 months, 3 weeks ago
On Wed, Apr 23, 2025 at 03:29:02PM -0600, Uday Shankar wrote:
> Heeding compiler warnings is generally a good idea, and is easy to do
> for kublk since there is not much source code. Turn warnings into errors
> so that anyone making changes is forced to heed them.
> 
> Signed-off-by: Uday Shankar <ushankar@purestorage.com>
> ---
>  tools/testing/selftests/ublk/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ublk/Makefile b/tools/testing/selftests/ublk/Makefile
> index ec4624a283bce2ebeed80509be6573c1b7a3623d..57e580253a68bc497b4292d07ab94d21f4feafdd 100644
> --- a/tools/testing/selftests/ublk/Makefile
> +++ b/tools/testing/selftests/ublk/Makefile
> @@ -1,6 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
>  
> -CFLAGS += -O3 -Wl,-no-as-needed -Wall -I $(top_srcdir)
> +CFLAGS += -O3 -Wl,-no-as-needed -Wall -Werror -I $(top_srcdir)
>  LDLIBS += -lpthread -lm -luring

Reviewed-by: Ming Lei <ming.lei@redhat.com>


Thanks,
Ming