C99 keyword "restrict" in package for Leap 42.2 not recognized

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

C99 keyword "restrict" in package for Leap 42.2 not recognized

Thomas Wagner
Hi,

I wanted to build gatling in obs.For Tumbleweed it builds. For Leap 42.1
and 42.2 I get errors like this [1]:
[   48s] dirfd.c:57:62: error: expected ';', ',' or ')' before 'key'
[   48s]  struct dircacheentry** hashtable_lookup(const char* restrict
key,size_t hashval) {

This leads to my conclusion that the C99 keyword restrict [2] is not
recognized for Leap but for Tumbleweed.
Is there a way to build C99 code for Leap?

best regards

Thomas

[1]
https://build.opensuse.org/package/live_build_log/home:Aikhjarto:branches:home:p_conrad/gatling/openSUSE_Leap_42.2/x86_64
[2] https://en.wikipedia.org/wiki/Restrict
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: C99 keyword "restrict" in package for Leap 42.2 not recognized

Andrei Borzenkov
27.11.2016 12:17, Thomas Wagner пишет:

> Hi,
>
> I wanted to build gatling in obs.For Tumbleweed it builds. For Leap 42.1
> and 42.2 I get errors like this [1]:
> [   48s] dirfd.c:57:62: error: expected ';', ',' or ')' before 'key'
> [   48s]  struct dircacheentry** hashtable_lookup(const char* restrict
> key,size_t hashval) {
>
> This leads to my conclusion that the C99 keyword restrict [2] is not
> recognized for Leap but for Tumbleweed.
> Is there a way to build C99 code for Leap?
>

Does adding --std=c99 to compiler options help?

> best regards
>
> Thomas
>
> [1]
> https://build.opensuse.org/package/live_build_log/home:Aikhjarto:branches:home:p_conrad/gatling/openSUSE_Leap_42.2/x86_64
>
> [2] https://en.wikipedia.org/wiki/Restrict

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: C99 keyword "restrict" in package for Leap 42.2 not recognized

Jan Engelhardt-4
In reply to this post by Thomas Wagner

On Sunday 2016-11-27 10:17, Thomas Wagner wrote:
>
> I wanted to build gatling in obs.For Tumbleweed it builds. For Leap 42.1 and
> 42.2 I get errors like this [1]:
> [   48s] dirfd.c:57:62: error: expected ';', ',' or ')' before 'key'
> [   48s]  struct dircacheentry** hashtable_lookup(const char* restrict
> key,size_t hashval) {

You have to use the GCC extension "__restrict" when using anything older than C99
or when using C++.
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: C99 keyword "restrict" in package for Leap 42.2 not recognized

Thomas Wagner
In reply to this post by Andrei Borzenkov
On 2016-11-27 10:39, Andrei Borzenkov wrote:
> 27.11.2016 12:17, Thomas Wagner пишет:
>
> Does adding --std=c99 to compiler options help?
Thanks for the hint.
However, the problem seems to be that the project has some c-files using
"register" from C99 and other using optarg which is not compatible with
--std=c99

--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: C99 keyword "restrict" in package for Leap 42.2 not recognized

Richard Biener
On Sun, 27 Nov 2016, Thomas Wagner wrote:

> On 2016-11-27 10:39, Andrei Borzenkov wrote:
> > 27.11.2016 12:17, Thomas Wagner пишет:
> >
> > Does adding --std=c99 to compiler options help?
> Thanks for the hint.
> However, the problem seems to be that the project has some c-files using
> "register" from C99 and other using optarg which is not compatible with
> --std=c99

Always use -std=gnu99 to enable GNU extensions as well.

Richard.

--
Richard Biener <[hidden email]>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nuernberg)
Reply | Threaded
Open this post in threaded view
|

Re: C99 keyword "restrict" in package for Leap 42.2 not recognized

Thomas Wagner
On 2016-11-28 09:22, Richard Biener wrote:

> On Sun, 27 Nov 2016, Thomas Wagner wrote:
>
>> On 2016-11-27 10:39, Andrei Borzenkov wrote:
>> > 27.11.2016 12:17, Thomas Wagner пишет:
>> >
>> > Does adding --std=c99 to compiler options help?
>> Thanks for the hint.
>> However, the problem seems to be that the project has some c-files
>> using
>> "register" from C99 and other using optarg which is not compatible
>> with
>> --std=c99
>
> Always use -std=gnu99 to enable GNU extensions as well.
Thank you! --std=gnu99 did the trick.

best regard

Thomas
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]