* [Buildroot] [PATCH 1/1] toolchain/helpers.mk: Use int as main return type
@ 2024-04-03 17:03 Petr Vorel
2024-04-08 20:37 ` Thomas Petazzoni via buildroot
2024-05-06 10:52 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Petr Vorel @ 2024-04-03 17:03 UTC (permalink / raw)
To: buildroot; +Cc: Petr Vorel, Robert Marko
Although -Wmain-return-type is not considered as error (unlike
-Wimplicit-int), but just a warning, let's fix it for the future.
<stdin>:1:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
Based on the fix from Robert
https://lore.kernel.org/buildroot/20240403121807.2087547-1-robimarko@gmail.com/
NOTE: I also updated config project ML to get
support/gnuconfig/config.guess fixed.
Kind regards,
Petr
toolchain/helpers.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index e5c838c0af..839ee278d0 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -483,7 +483,7 @@ check_unusable_toolchain = \
#
check_toolchain_ssp = \
__CROSS_CC=$(strip $1) ; \
- __HAS_SSP=`echo 'void main(){}' | $${__CROSS_CC} -Werror -fstack-protector -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 && echo y` ; \
+ __HAS_SSP=`echo 'int main(){}' | $${__CROSS_CC} -Werror -fstack-protector -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 && echo y` ; \
if [ "$(BR2_TOOLCHAIN_HAS_SSP)" != "y" -a "$${__HAS_SSP}" = "y" ] ; then \
echo "SSP support available in this toolchain, please enable BR2_TOOLCHAIN_EXTERNAL_HAS_SSP" ; \
exit 1 ; \
@@ -494,7 +494,7 @@ check_toolchain_ssp = \
fi ; \
__SSP_OPTION=$(2); \
if [ -n "$${__SSP_OPTION}" ] ; then \
- if ! echo 'void main(){}' | $${__CROSS_CC} -Werror $${__SSP_OPTION} -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 ; then \
+ if ! echo 'int main(){}' | $${__CROSS_CC} -Werror $${__SSP_OPTION} -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 ; then \
echo "SSP option $${__SSP_OPTION} not available in this toolchain, please select another SSP level" ; \
exit 1 ; \
fi; \
--
2.43.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] toolchain/helpers.mk: Use int as main return type
2024-04-03 17:03 [Buildroot] [PATCH 1/1] toolchain/helpers.mk: Use int as main return type Petr Vorel
@ 2024-04-08 20:37 ` Thomas Petazzoni via buildroot
2024-05-06 10:52 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-04-08 20:37 UTC (permalink / raw)
To: Petr Vorel; +Cc: Robert Marko, buildroot
On Wed, 3 Apr 2024 19:03:51 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:
> Although -Wmain-return-type is not considered as error (unlike
> -Wimplicit-int), but just a warning, let's fix it for the future.
>
> <stdin>:1:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
>
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
> Based on the fix from Robert
> https://lore.kernel.org/buildroot/20240403121807.2087547-1-robimarko@gmail.com/
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Buildroot] [PATCH 1/1] toolchain/helpers.mk: Use int as main return type
2024-04-03 17:03 [Buildroot] [PATCH 1/1] toolchain/helpers.mk: Use int as main return type Petr Vorel
2024-04-08 20:37 ` Thomas Petazzoni via buildroot
@ 2024-05-06 10:52 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-05-06 10:52 UTC (permalink / raw)
To: Petr Vorel; +Cc: Robert Marko, buildroot
>>>>> "Petr" == Petr Vorel <petr.vorel@gmail.com> writes:
> Although -Wmain-return-type is not considered as error (unlike
> -Wimplicit-int), but just a warning, let's fix it for the future.
> <stdin>:1:1: warning: return type of 'main' is not 'int' [-Wmain-return-type]
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
> Based on the fix from Robert
> https://lore.kernel.org/buildroot/20240403121807.2087547-1-robimarko@gmail.com/
> NOTE: I also updated config project ML to get
> support/gnuconfig/config.guess fixed.
Committed to 2024.02.x, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-05-06 10:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-03 17:03 [Buildroot] [PATCH 1/1] toolchain/helpers.mk: Use int as main return type Petr Vorel
2024-04-08 20:37 ` Thomas Petazzoni via buildroot
2024-05-06 10:52 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox