LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* arm: kprobe compilation error
@ 2015-02-05 15:17 Janusz Użycki
  2015-02-07  7:22 ` Masami Hiramatsu
  2015-02-09  9:44 ` Jon Medhurst (Tixy)
  0 siblings, 2 replies; 6+ messages in thread
From: Janusz Użycki @ 2015-02-05 15:17 UTC (permalink / raw)
  To: Russell King, Jon Medhurst (Tixy),
	David A. Long, Masami Hiramatsu, Wang Nan, linux-arm-kernel,
	linux-kernel

Hi,

I got the compilation error on next-20150204:

   CC      arch/arm/probes/kprobes/actions-arm.o
In file included from arch/arm/probes/kprobes/actions-common.c:18:
arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
than a declaration
make[2]: *** [arch/arm/probes/kprobes/actions-common.o] Błąd 1
make[2]: *** Oczekiwanie na niezakończone zadania....
In file included from arch/arm/probes/kprobes/actions-arm.c:66:
arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
than a declaration
make[2]: *** [arch/arm/probes/kprobes/actions-arm.o] Błąd 1
In file included from arch/arm/probes/kprobes/core.c:37:
arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
than a declaration
make[2]: *** [arch/arm/probes/kprobes/core.o] Błąd 1
make[1]: *** [arch/arm/probes/kprobes] Błąd 2
make: *** [arch/arm/probes] Błąd 2

reason is *[*]:
const struct decode_checker *[*]);
                                                      ^

target: mxs (arm926)
gcc version 4.2.4


best regards
Janusz


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: arm: kprobe compilation error
  2015-02-05 15:17 arm: kprobe compilation error Janusz Użycki
@ 2015-02-07  7:22 ` Masami Hiramatsu
  2015-02-09  9:44 ` Jon Medhurst (Tixy)
  1 sibling, 0 replies; 6+ messages in thread
From: Masami Hiramatsu @ 2015-02-07  7:22 UTC (permalink / raw)
  To: Janusz Użycki
  Cc: Russell King, Jon Medhurst (Tixy),
	David A. Long, Wang Nan, linux-arm-kernel, linux-kernel

(2015/02/06 0:17), Janusz Użycki wrote:
> Hi,
> 
> I got the compilation error on next-20150204:
> 
>    CC      arch/arm/probes/kprobes/actions-arm.o
> In file included from arch/arm/probes/kprobes/actions-common.c:18:
> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
> than a declaration
> make[2]: *** [arch/arm/probes/kprobes/actions-common.o] Błąd 1
> make[2]: *** Oczekiwanie na niezakończone zadania....
> In file included from arch/arm/probes/kprobes/actions-arm.c:66:
> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
> than a declaration
> make[2]: *** [arch/arm/probes/kprobes/actions-arm.o] Błąd 1
> In file included from arch/arm/probes/kprobes/core.c:37:
> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
> than a declaration
> make[2]: *** [arch/arm/probes/kprobes/core.o] Błąd 1
> make[1]: *** [arch/arm/probes/kprobes] Błąd 2
> make: *** [arch/arm/probes] Błąd 2
> 
> reason is *[*]:
> const struct decode_checker *[*]);

Thank you for reporting!

I think there is a typo, it should be "const struct decode_checker *[]".


Thank you,


-- 
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: arm: kprobe compilation error
  2015-02-05 15:17 arm: kprobe compilation error Janusz Użycki
  2015-02-07  7:22 ` Masami Hiramatsu
@ 2015-02-09  9:44 ` Jon Medhurst (Tixy)
  2015-02-09 11:00   ` Janusz Użycki
  1 sibling, 1 reply; 6+ messages in thread
From: Jon Medhurst (Tixy) @ 2015-02-09  9:44 UTC (permalink / raw)
  To: Janusz Użycki
  Cc: Russell King, David A. Long, Masami Hiramatsu, Wang Nan,
	linux-arm-kernel, linux-kernel

Hi Janusz

On Thu, 2015-02-05 at 16:17 +0100, Janusz Użycki wrote:
> I got the compilation error on next-20150204:
> 
[...]
> In file included from arch/arm/probes/kprobes/core.c:37:
> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other 
> than a declaration
[...]
> gcc version 4.2.4

Thanks for reporting this, is it OK if I add to a patch to fix this a
line saying "Reported-by: Janusz Użycki <j.uzycki@elproma.com.pl>"?

Whilst the extra '*' looks like an obvious typo, it's interesting that
your error message implies that it's allowed in some situations and that
the version of GCC that I use (4.9.1) doesn't complain about it.
If it's valid C, I've no idea what that syntax that might represent.

-- 
Tixy 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: arm: kprobe compilation error
  2015-02-09  9:44 ` Jon Medhurst (Tixy)
@ 2015-02-09 11:00   ` Janusz Użycki
  2015-02-10  8:28     ` Wang Nan
  0 siblings, 1 reply; 6+ messages in thread
From: Janusz Użycki @ 2015-02-09 11:00 UTC (permalink / raw)
  To: Jon Medhurst (Tixy)
  Cc: Russell King, David A. Long, Masami Hiramatsu, Wang Nan,
	linux-arm-kernel, linux-kernel


W dniu 2015-02-09 o 10:44, Jon Medhurst (Tixy) pisze:
> Hi Janusz
>
> On Thu, 2015-02-05 at 16:17 +0100, Janusz Użycki wrote:
>> I got the compilation error on next-20150204:
>>
> [...]
>> In file included from arch/arm/probes/kprobes/core.c:37:
>> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other
>> than a declaration
> [...]
>> gcc version 4.2.4
> Thanks for reporting this, is it OK if I add to a patch to fix this a
> line saying "Reported-by: Janusz Użycki <j.uzycki@elproma.com.pl>"?

sure

>
> Whilst the extra '*' looks like an obvious typo, it's interesting that
> your error message implies that it's allowed in some situations and that
> the version of GCC that I use (4.9.1) doesn't complain about it.
> If it's valid C, I've no idea what that syntax that might represent.
>
I've not find such extension in C11 but likely gcc's team knows the answer.
It also compiles using gcc 4.8.3. However I thing more people use older 
compilers
for different platforms.

best regards
Janusz


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: arm: kprobe compilation error
  2015-02-09 11:00   ` Janusz Użycki
@ 2015-02-10  8:28     ` Wang Nan
  2015-02-10  9:36       ` Wang Nan
  0 siblings, 1 reply; 6+ messages in thread
From: Wang Nan @ 2015-02-10  8:28 UTC (permalink / raw)
  To: Janusz Użycki, Jon Medhurst (Tixy)
  Cc: Russell King, David A. Long, Masami Hiramatsu, linux-arm-kernel,
	linux-kernel, Li Zefan

On 2015/2/9 19:00, Janusz Użycki wrote:
> 
> W dniu 2015-02-09 o 10:44, Jon Medhurst (Tixy) pisze:
>> Hi Janusz
>>
>> On Thu, 2015-02-05 at 16:17 +0100, Janusz Użycki wrote:
>>> I got the compilation error on next-20150204:
>>>
>> [...]
>>> In file included from arch/arm/probes/kprobes/core.c:37:
>>> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other
>>> than a declaration
>> [...]
>>> gcc version 4.2.4
>> Thanks for reporting this, is it OK if I add to a patch to fix this a
>> line saying "Reported-by: Janusz Użycki <j.uzycki@elproma.com.pl>"?
> 
> sure
> 
>>
>> Whilst the extra '*' looks like an obvious typo, it's interesting that
>> your error message implies that it's allowed in some situations and that
>> the version of GCC that I use (4.9.1) doesn't complain about it.
>> If it's valid C, I've no idea what that syntax that might represent.
>>
> I've not find such extension in C11 but likely gcc's team knows the answer.
> It also compiles using gcc 4.8.3. However I thing more people use older compilers
> for different platforms.
> 

Hi All,

Thanks for reporting and fixing this.

When writing this code I checked C spec from open-std (n1548 and n1570). I got an
feeling that [*] should be a standard way to specify variable length array types.
Please see 6.7.6.3 and 6.7.7 of the spec. However I forgot there are old gccs which
don't support that standard.

Thank you!

> best regards
> Janusz
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: arm: kprobe compilation error
  2015-02-10  8:28     ` Wang Nan
@ 2015-02-10  9:36       ` Wang Nan
  0 siblings, 0 replies; 6+ messages in thread
From: Wang Nan @ 2015-02-10  9:36 UTC (permalink / raw)
  To: Janusz Użycki, Jon Medhurst (Tixy)
  Cc: Russell King, linux-kernel, Li Zefan, David A. Long,
	Masami Hiramatsu, linux-arm-kernel

On 2015/2/10 16:28, Wang Nan wrote:
> On 2015/2/9 19:00, Janusz Użycki wrote:
>>
>> W dniu 2015-02-09 o 10:44, Jon Medhurst (Tixy) pisze:
>>> Hi Janusz
>>>
>>> On Thu, 2015-02-05 at 16:17 +0100, Janusz Użycki wrote:
>>>> I got the compilation error on next-20150204:
>>>>
>>> [...]
>>>> In file included from arch/arm/probes/kprobes/core.c:37:
>>>> arch/arm/probes/kprobes/core.h:43: error: '[*]' not allowed in other
>>>> than a declaration
>>> [...]
>>>> gcc version 4.2.4
>>> Thanks for reporting this, is it OK if I add to a patch to fix this a
>>> line saying "Reported-by: Janusz Użycki <j.uzycki@elproma.com.pl>"?
>>
>> sure
>>
>>>
>>> Whilst the extra '*' looks like an obvious typo, it's interesting that
>>> your error message implies that it's allowed in some situations and that
>>> the version of GCC that I use (4.9.1) doesn't complain about it.
>>> If it's valid C, I've no idea what that syntax that might represent.
>>>
>> I've not find such extension in C11 but likely gcc's team knows the answer.
>> It also compiles using gcc 4.8.3. However I thing more people use older compilers
>> for different platforms.
>>
> 
> Hi All,
> 
> Thanks for reporting and fixing this.
> 
> When writing this code I checked C spec from open-std (n1548 and n1570). I got an
> feeling that [*] should be a standard way to specify variable length array types.
> Please see 6.7.6.3 and 6.7.7 of the spec. However I forgot there are old gccs which
> don't support that standard.
> 
> Thank you!
> 

I did a boring searching and found some useful information:

The '[*]' syntax was introduced at 1997 as part of variable length array (VLA) support:

http://www.open-std.org/JTC1/SC22/WG14/www/docs/n683.htm

so it is not a new extension. However, according to 6.7.6.2 of the spec:

   If the size is not present, the array type is an incomplete type. If the size is * instead of
   being an expression, the array type is a variable length array type of unspecified size,
   ...
   (Variable length arrays are a conditional feature that implementations need not support; see 6.10.8.3.)

and 6.10.8.3 provides a macro:

   __STDC_NO_VLA__ The integer constant 1, intended to indicate that the
       implementation does not support variable length arrays or variably
       modified types.

In our situation what we need is an incomplete type of array, so Tixy's fix is correct.
It's my fault to incorrectly use VLA.

Thank you.

>> best regards
>> Janusz
>>
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-02-10  9:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 15:17 arm: kprobe compilation error Janusz Użycki
2015-02-07  7:22 ` Masami Hiramatsu
2015-02-09  9:44 ` Jon Medhurst (Tixy)
2015-02-09 11:00   ` Janusz Użycki
2015-02-10  8:28     ` Wang Nan
2015-02-10  9:36       ` Wang Nan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).