diff mbox series

[1/1] Makefile: pass -ansi option to cmd_gen_envp

Message ID 20231215111333.31286-1-sebastien.szymanski@armadeus.com
State Changes Requested
Delegated to: Fabio Estevam
Headers show
Series [1/1] Makefile: pass -ansi option to cmd_gen_envp | expand

Commit Message

Sébastien Szymanski Dec. 15, 2023, 11:13 a.m. UTC
Without the '-ansi' option, the 'linux' string in env. files is replaced
with the string '1 '. For example, in the
board/armadeus/opos6uldev/opos6uldev.env file,

kernelimg=opos6ul-linux.bin

becomes

kernelimg=opos6ul-1 .bin

in the include/generated/env.in.

That's because 'linux' is a System-specific Predefined Macros. [1]

Pass the '-ansi' option as suggested by the GCC documentation. [1]
Fix the two .env files using C++ comment style for their SPDX licence.

[1] https://gcc.gnu.org/onlinedocs/gcc-13.2.0/cpp/System-specific-Predefined-Macros.html

Signed-off-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
 Makefile                            | 3 ++-
 board/siemens/iot2050/iot2050.env   | 2 +-
 board/storopack/smegw01/smegw01.env | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

Comments

Fabio Estevam Dec. 15, 2023, 12:03 p.m. UTC | #1
Hi Sébastien,

On Fri, Dec 15, 2023 at 8:14 AM Sébastien Szymanski
<sebastien.szymanski@armadeus.com> wrote:

> --- a/board/siemens/iot2050/iot2050.env
> +++ b/board/siemens/iot2050/iot2050.env
> @@ -1,4 +1,4 @@
> -// SPDX-License-Identifier: GPL-2.0+
> +/* SPDX-License-Identifier: GPL-2.0+ */

This is an unrelated change.

>  /*
>   * Copyright (c) Siemens AG, 2023
>   *
> diff --git a/board/storopack/smegw01/smegw01.env b/board/storopack/smegw01/smegw01.env
> index 93de8669109d..6807ada71887 100644
> --- a/board/storopack/smegw01/smegw01.env
> +++ b/board/storopack/smegw01/smegw01.env
> @@ -1,4 +1,4 @@
> -// SPDX-License-Identifier: GPL-2.0+
> +/* SPDX-License-Identifier: GPL-2.0+ */

Same here.
Sébastien Szymanski Dec. 15, 2023, 1:25 p.m. UTC | #2
Hi Fabio,

On 12/15/23 13:03, Fabio Estevam wrote:
> Hi Sébastien,
> 
> On Fri, Dec 15, 2023 at 8:14 AM Sébastien Szymanski
> <sebastien.szymanski@armadeus.com> wrote:
> 
>> --- a/board/siemens/iot2050/iot2050.env
>> +++ b/board/siemens/iot2050/iot2050.env
>> @@ -1,4 +1,4 @@
>> -// SPDX-License-Identifier: GPL-2.0+
>> +/* SPDX-License-Identifier: GPL-2.0+ */
> 

With the -ansi option, the C++ style comments make an error:

include/generated/env.txt:1:1: error: C++ style comments are not allowed 
in ISO C90
     1 | // SPDX-License-Identifier: GPL-2.0+

I should have mention that in my commit log.

Regards,

> This is an unrelated change.
> 
>>   /*
>>    * Copyright (c) Siemens AG, 2023
>>    *
>> diff --git a/board/storopack/smegw01/smegw01.env b/board/storopack/smegw01/smegw01.env
>> index 93de8669109d..6807ada71887 100644
>> --- a/board/storopack/smegw01/smegw01.env
>> +++ b/board/storopack/smegw01/smegw01.env
>> @@ -1,4 +1,4 @@
>> -// SPDX-License-Identifier: GPL-2.0+
>> +/* SPDX-License-Identifier: GPL-2.0+ */
> 
> Same here.
Fabio Estevam Dec. 15, 2023, 2:35 p.m. UTC | #3
Hi Sébastien,

On Fri, Dec 15, 2023 at 10:26 AM Sébastien Szymanski
<sebastien.szymanski@armadeus.com> wrote:

> With the -ansi option, the C++ style comments make an error:
>
> include/generated/env.txt:1:1: error: C++ style comments are not allowed
> in ISO C90
>      1 | // SPDX-License-Identifier: GPL-2.0+
>
> I should have mention that in my commit log.

Thanks for the clarification.

Please include this information into the commit log a and submit a v2.
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 750bbdb1b713..5fc7a20df7f0 100644
--- a/Makefile
+++ b/Makefile
@@ -1803,7 +1803,8 @@  ENV_FILE := $(if $(ENV_SOURCE_FILE),$(ENV_FILE_CFG),$(wildcard $(ENV_FILE_BOARD)
 quiet_cmd_gen_envp = ENVP    $@
       cmd_gen_envp = \
 	if [ -s "$(ENV_FILE)" ]; then \
-		$(CPP) -P $(CFLAGS) -x assembler-with-cpp -D__ASSEMBLY__ \
+		$(CPP) -P $(CFLAGS) -x assembler-with-cpp -ansi \
+			-D__ASSEMBLY__ \
 			-D__UBOOT_CONFIG__ \
 			-I . -I include -I $(srctree)/include \
 			-include linux/kconfig.h -include include/config.h \
diff --git a/board/siemens/iot2050/iot2050.env b/board/siemens/iot2050/iot2050.env
index 8bbd7abe98f0..a3bdbf4f6998 100644
--- a/board/siemens/iot2050/iot2050.env
+++ b/board/siemens/iot2050/iot2050.env
@@ -1,4 +1,4 @@ 
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Copyright (c) Siemens AG, 2023
  *
diff --git a/board/storopack/smegw01/smegw01.env b/board/storopack/smegw01/smegw01.env
index 93de8669109d..6807ada71887 100644
--- a/board/storopack/smegw01/smegw01.env
+++ b/board/storopack/smegw01/smegw01.env
@@ -1,4 +1,4 @@ 
-// SPDX-License-Identifier: GPL-2.0+
+/* SPDX-License-Identifier: GPL-2.0+ */
 #ifdef CONFIG_SYS_BOOT_LOCKED
 #define SETUP_BOOT_MENU setup_boot_menu=setenv bootmenu_0 eMMC=run bootcmd
 #else