All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] xenomai/asm/xenomai/syscall.h is not c99 aware
@ 2010-03-06 11:05 Daniele Nicolodi
  2010-03-06 11:21 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Daniele Nicolodi @ 2010-03-06 11:05 UTC (permalink / raw)
  To: xenomai

Hello. I'm compiling my programs with the -std=c99 switch. However the
inclusion of pthread.h from xenomai distribution causes the compilation
to fail with syntax errors.

This simple program demonstrates the problem:

#include <pthread.h>

int main(int argc, char **argv)
{
     return 0;
}

If I compile it with 'gcc -std=c99 $(xeno-config --posis-cflags)' i
obtain the following errors:

In file included from /usr/include/xenomai/nucleus/trace.h:52,
                 from /usr/include/xenomai/nucleus/system.h:27,
                 from /usr/include/xenomai/asm/xenomai/system_32.h:130,
                 from /usr/include/xenomai/asm/xenomai/system.h:2,
                 from /usr/include/xenomai/nucleus/types.h:40,
                 from /usr/include/xenomai/nucleus/thread.h:25,
                 from /usr/include/xenomai/posix/pthread.h:136,
                 from test-c99.c:1:
/usr/include/xenomai/asm/xenomai/syscall.h:130: error: expected
declaration specifiers or ‘...’ before string constant
/usr/include/xenomai/asm/xenomai/syscall.h:130: warning: data definition
has no type or storage class
/usr/include/xenomai/asm/xenomai/syscall.h:130: warning: type defaults
to ‘int’ in declaration of ‘asm’
/usr/include/xenomai/asm/xenomai/syscall.h: In function ‘__xn_get_ebp’:
/usr/include/xenomai/asm/xenomai/syscall.h:173: warning: statement with
no effect
/usr/include/xenomai/asm/xenomai/syscall.h:173: error: expected ‘;’
before ‘volatile’
/usr/include/xenomai/asm/xenomai/syscall.h: In function ‘__xn_rdtsc’:
/usr/include/xenomai/asm/xenomai/syscall.h:436: warning: statement with
no effect
/usr/include/xenomai/asm/xenomai/syscall.h:436: error: expected ‘;’
before ‘volatile’
In file included from /usr/include/xenomai/nucleus/system.h:27,
                 from /usr/include/xenomai/asm/xenomai/system_32.h:130,
                 from /usr/include/xenomai/asm/xenomai/system.h:2,
                 from /usr/include/xenomai/nucleus/types.h:40,
                 from /usr/include/xenomai/nucleus/thread.h:25,
                 from /usr/include/xenomai/posix/pthread.h:136,
                 from test-c99.c:1:
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_max_begin’:
/usr/include/xenomai/nucleus/trace.h:56: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:56: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_max_end’:
/usr/include/xenomai/nucleus/trace.h:61: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:61: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_max_reset’:
/usr/include/xenomai/nucleus/trace.h:66: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:66: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_user_start’:
/usr/include/xenomai/nucleus/trace.h:71: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:71: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_user_stop’:
/usr/include/xenomai/nucleus/trace.h:76: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:76: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_user_freeze’:
/usr/include/xenomai/nucleus/trace.h:81: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:81: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_special’:
/usr/include/xenomai/nucleus/trace.h:87: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:87: warning: statement with no effect
/usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_special_u64’:
/usr/include/xenomai/nucleus/trace.h:92: error: expected ‘;’ before
‘volatile’
/usr/include/xenomai/nucleus/trace.h:92: warning: statement with no effect

Of course i do not obtain any error it i remove the xenomai specific
include directories options from the gcc command line.

Can this problem be solved? Can I help somehow?

Thanks. Cheers,
-- 
Daniele


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

* Re: [Xenomai-help] xenomai/asm/xenomai/syscall.h is not c99 aware
  2010-03-06 11:05 [Xenomai-help] xenomai/asm/xenomai/syscall.h is not c99 aware Daniele Nicolodi
@ 2010-03-06 11:21 ` Gilles Chanteperdrix
  2010-03-06 11:40   ` Daniele Nicolodi
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2010-03-06 11:21 UTC (permalink / raw)
  To: Daniele Nicolodi; +Cc: xenomai

Daniele Nicolodi wrote:
> Hello. I'm compiling my programs with the -std=c99 switch. However the
> inclusion of pthread.h from xenomai distribution causes the compilation
> to fail with syntax errors.
> 
> This simple program demonstrates the problem:
> 
> #include <pthread.h>
> 
> int main(int argc, char **argv)
> {
>      return 0;
> }
> 
> If I compile it with 'gcc -std=c99 $(xeno-config --posis-cflags)' i
> obtain the following errors:
> 
> In file included from /usr/include/xenomai/nucleus/trace.h:52,
>                  from /usr/include/xenomai/nucleus/system.h:27,
>                  from /usr/include/xenomai/asm/xenomai/system_32.h:130,
>                  from /usr/include/xenomai/asm/xenomai/system.h:2,
>                  from /usr/include/xenomai/nucleus/types.h:40,
>                  from /usr/include/xenomai/nucleus/thread.h:25,
>                  from /usr/include/xenomai/posix/pthread.h:136,
>                  from test-c99.c:1:
> /usr/include/xenomai/asm/xenomai/syscall.h:130: error: expected
> declaration specifiers or ‘...’ before string constant
> /usr/include/xenomai/asm/xenomai/syscall.h:130: warning: data definition
> has no type or storage class
> /usr/include/xenomai/asm/xenomai/syscall.h:130: warning: type defaults
> to ‘int’ in declaration of ‘asm’
> /usr/include/xenomai/asm/xenomai/syscall.h: In function ‘__xn_get_ebp’:
> /usr/include/xenomai/asm/xenomai/syscall.h:173: warning: statement with
> no effect
> /usr/include/xenomai/asm/xenomai/syscall.h:173: error: expected ‘;’
> before ‘volatile’
> /usr/include/xenomai/asm/xenomai/syscall.h: In function ‘__xn_rdtsc’:
> /usr/include/xenomai/asm/xenomai/syscall.h:436: warning: statement with
> no effect
> /usr/include/xenomai/asm/xenomai/syscall.h:436: error: expected ‘;’
> before ‘volatile’
> In file included from /usr/include/xenomai/nucleus/system.h:27,
>                  from /usr/include/xenomai/asm/xenomai/system_32.h:130,
>                  from /usr/include/xenomai/asm/xenomai/system.h:2,
>                  from /usr/include/xenomai/nucleus/types.h:40,
>                  from /usr/include/xenomai/nucleus/thread.h:25,
>                  from /usr/include/xenomai/posix/pthread.h:136,
>                  from test-c99.c:1:
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_max_begin’:
> /usr/include/xenomai/nucleus/trace.h:56: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:56: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_max_end’:
> /usr/include/xenomai/nucleus/trace.h:61: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:61: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_max_reset’:
> /usr/include/xenomai/nucleus/trace.h:66: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:66: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_user_start’:
> /usr/include/xenomai/nucleus/trace.h:71: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:71: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_user_stop’:
> /usr/include/xenomai/nucleus/trace.h:76: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:76: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_user_freeze’:
> /usr/include/xenomai/nucleus/trace.h:81: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:81: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_special’:
> /usr/include/xenomai/nucleus/trace.h:87: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:87: warning: statement with no effect
> /usr/include/xenomai/nucleus/trace.h: In function ‘xntrace_special_u64’:
> /usr/include/xenomai/nucleus/trace.h:92: error: expected ‘;’ before
> ‘volatile’
> /usr/include/xenomai/nucleus/trace.h:92: warning: statement with no effect
> 
> Of course i do not obtain any error it i remove the xenomai specific
> include directories options from the gcc command line.
> 
> Can this problem be solved? Can I help somehow?

What version of Xenomai, what platforms? Chances are that Xenomai
headers contain inline assembly code and things like that which are
definitely not ansi, and we even use GNU extensions. I am afraid you
will have to compile with -std=gnu99.

It probably can be made to work. But... do you realy need -std=c99 ?

-- 
					    Gilles.



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

* Re: [Xenomai-help] xenomai/asm/xenomai/syscall.h is not c99 aware
  2010-03-06 11:21 ` Gilles Chanteperdrix
@ 2010-03-06 11:40   ` Daniele Nicolodi
       [not found]     ` <4B9531A3.9040308@domain.hid>
  0 siblings, 1 reply; 4+ messages in thread
From: Daniele Nicolodi @ 2010-03-06 11:40 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Gilles Chanteperdrix wrote:
> Daniele Nicolodi wrote:
>> Hello. I'm compiling my programs with the -std=c99 switch. However the
>> inclusion of pthread.h from xenomai distribution causes the compilation
>> to fail with syntax errors.

> What version of Xenomai, what platforms? Chances are that Xenomai
> headers contain inline assembly code and things like that which are
> definitely not ansi, and we even use GNU extensions. I am afraid you
> will have to compile with -std=gnu99.

Sorry. Forgot to include those informations. Xenomai version 2.5.1 on a
debian unstable x86 box with gcc 4.4.3.

> It probably can be made to work. But... do you realy need -std=c99 ?

I didn't know about -std=gnu99. I can certainly use this extension.

Thanks. Cheers,
-- 
Daniele



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

* Re: [Xenomai-help] xenomai/asm/xenomai/syscall.h is not c99 aware
       [not found]       ` <4B9BC623.6020304@domain.hid>
@ 2010-03-17  9:44         ` Daniele Nicolodi
  0 siblings, 0 replies; 4+ messages in thread
From: Daniele Nicolodi @ 2010-03-17  9:44 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

Gilles Chanteperdrix wrote:
> Daniele Nicolodi wrote:
>> Daniele Nicolodi wrote:
>>
>>>> It probably can be made to work. But... do you realy need -std=c99 ?
>>> I didn't know about -std=gnu99. I can certainly use this extension.
>> It looks like using -std=gnu99 causes somehow the compilation to fail at
>> linking time. Gcc complains about multiple defined symbols in the object
>> files. However, my very limited knowledge of how compilers work do not
>> let me understand the problem.

> It should be fixed by this patch:
> http://git.xenomai.org/?p=xenomai-2.5.git;a=commitdiff;h=8cfc1103fe1cf9e700698e8230baf562ffb5cf06;hp=0386ae9a4e8befc67088e247b65be534d34efbe1
> 
> Could you try it?

It fixes the problem. Thanks.

Cheers,
-- 
Daniele



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

end of thread, other threads:[~2010-03-17  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-06 11:05 [Xenomai-help] xenomai/asm/xenomai/syscall.h is not c99 aware Daniele Nicolodi
2010-03-06 11:21 ` Gilles Chanteperdrix
2010-03-06 11:40   ` Daniele Nicolodi
     [not found]     ` <4B9531A3.9040308@domain.hid>
     [not found]       ` <4B9BC623.6020304@domain.hid>
2010-03-17  9:44         ` Daniele Nicolodi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.