Skip to contentSkip to conversation

kbuild: Remove -Waggregate-return from scripts/Makefile.extrawarn

PATCH In review Mathieu Malaterre 2 participants 2 messages May 29, 2019 – Jun 4, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Remove -Waggregate-return from scripts/Makefile.extrawarn

It makes little sense to pass -Waggregate-return these days since large part of the linux kernel rely on returning struct(s). For instance:

../include/linux/timekeeping.h: In function 'show_uptime':
../include/linux/ktime.h:91:34: error: function call has aggregate value [-Werror=aggregate-return]

   #define ktime_to_timespec64(kt)  ns_to_timespec64((kt))
                                    ^~~~~~~~~~~~~~~~~~~~~~
  ../include/linux/timekeeping.h:166:8: note: in expansion of macro 'ktime_to_timespec64'
    *ts = ktime_to_timespec64(ktime_get_coarse_boottime());

Remove this warning from W=2 completely.

---
 scripts/Makefile.extrawarn | 1 -
 1 file changed, 1 deletion(-)
scripts/Makefile.extrawarn +0 -1
index 3ab8d1a303cd..98081ab300e5 100644
@@ -34,7 +34,6 @@ warning-1 += $(call cc-option, -Wstringop-truncation)
 warning-1 += -Wno-missing-field-initializers
 warning-1 += -Wno-sign-compare
 
-warning-2 := -Waggregate-return
 warning-2 += -Wcast-align
 warning-2 += -Wdisabled-optimization
 warning-2 += -Wnested-externs
Signature · 1 line
2.20.1
#1 lore raw
Quoted 11 lines · Mathieu Malaterre

It makes little sense to pass -Waggregate-return these days since large part of the linux kernel rely on returning struct(s). For instance:

../include/linux/timekeeping.h: In function 'show_uptime':
../include/linux/ktime.h:91:34: error: function call has aggregate value [-Werror=aggregate-return]

   #define ktime_to_timespec64(kt)  ns_to_timespec64((kt))
                                    ^~~~~~~~~~~~~~~~~~~~~~
  ../include/linux/timekeeping.h:166:8: note: in expansion of macro 'ktime_to_timespec64'
    *ts = ktime_to_timespec64(ktime_get_coarse_boottime());
Quoted 4 lines

Remove this warning from W=2 completely.

---

Applied to linux-kbuild. Thanks.

Quoted 18 lines
 scripts/Makefile.extrawarn | 1 -
 1 file changed, 1 deletion(-)
scripts/Makefile.extrawarn +0 -2
index 3ab8d1a303cd..98081ab300e5 100644
@@ -34,7 +34,6 @@ warning-1 += $(call cc-option, -Wstringop-truncation)
 warning-1 += -Wno-missing-field-initializers
 warning-1 += -Wno-sign-compare
 
-warning-2 := -Waggregate-return
 warning-2 += -Wcast-align
 warning-2 += -Wdisabled-optimization
 warning-2 += -Wnested-externs
--

2.20.1

Signature · 2 lines
Best Regards
Masahiro Yamada