Re: [PATCH] trace/osnoise: Do not use 'main' as variable name

From: Guenter Roeck
Date: Wed Sep 08 2021 - 12:34:25 EST


On 9/8/21 8:53 AM, Steven Rostedt wrote:
On Wed, 8 Sep 2021 08:14:07 -0700
Guenter Roeck <linux@xxxxxxxxxxxx> wrote:

gcc 11.x may get a hiccup when encountering 'main' as variable name.

kernel/trace/trace_osnoise.c: In function 'start_kthread':
kernel/trace/trace_osnoise.c:1515:8: error: 'main' is usually a function

Use a different variable name to silence it.

Egad, no. NACK! Double NACK. Linus already NACK'd this.

(although it's ironic that he also added -Werror as the default :-/ )

The bug in is in gcc, go send them a patch.

THERE IS NO ISSUE WITH HAVING A LOCAL VARIABLE NAMED "main"!!!!

This has already been discussed:

https://lore.kernel.org/all/CAHk-=whHxeUjaNrWOLb0qx=-nibRZzQomwkw9xMPH_aHCf=BWQ@xxxxxxxxxxxxxx/

For now, the workaround is this patch:

https://lore.kernel.org/all/20210813224131.25803-1-rdunlap@xxxxxxxxxxxxx/


No problem. Sorry, I didn't find the other patch.

FWIW, it wasn't gcc 11.x, it was gcc 8.1, which is the only gcc version
that I can get to compile nds32 images (more recent versions either fail
to compile gcc, or fail to build the kernel with assembler errors).
I'll just stop build testing nds32:allmodconfig instead.

Guenter