linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch to get iw building on Fedora 8
@ 2010-09-21 16:39 Ben Greear
  2010-09-21 17:28 ` Johannes Berg
  2010-09-21 19:49 ` Andreas Schwab
  0 siblings, 2 replies; 10+ messages in thread
From: Ben Greear @ 2010-09-21 16:39 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org

I need this in order to get iw to build on Fedora 8.

[greearb@fs2 iw]$ git diff
diff --git a/bitrate.c b/bitrate.c
index 8de8839..9b6defc 100644
--- a/bitrate.c
+++ b/bitrate.c
@@ -1,4 +1,6 @@
  #include <errno.h>
+#define  __USE_ISOC99
+#include <stdlib.h>

  #include "nl80211.h"
  #include "iw.h"

Signed-off-by:  Ben Greear<greearb@candelatech.com>

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: Patch to get iw building on Fedora 8
  2010-09-21 16:39 Patch to get iw building on Fedora 8 Ben Greear
@ 2010-09-21 17:28 ` Johannes Berg
  2010-09-23 23:05   ` Ben Greear
  2010-09-21 19:49 ` Andreas Schwab
  1 sibling, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2010-09-21 17:28 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless@vger.kernel.org

On Tue, 2010-09-21 at 09:39 -0700, Ben Greear wrote:
> I need this in order to get iw to build on Fedora 8.
> 
> [greearb@fs2 iw]$ git diff
> diff --git a/bitrate.c b/bitrate.c
> index 8de8839..9b6defc 100644
> --- a/bitrate.c
> +++ b/bitrate.c
> @@ -1,4 +1,6 @@
>   #include <errno.h>
> +#define  __USE_ISOC99
> +#include <stdlib.h>

had to add #ifndef guards, but applied it.

johannes


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

* Re: Patch to get iw building on Fedora 8
  2010-09-21 16:39 Patch to get iw building on Fedora 8 Ben Greear
  2010-09-21 17:28 ` Johannes Berg
@ 2010-09-21 19:49 ` Andreas Schwab
  2010-09-21 21:09   ` Ben Greear
  1 sibling, 1 reply; 10+ messages in thread
From: Andreas Schwab @ 2010-09-21 19:49 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless

Ben Greear <greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org> writes:

> I need this in order to get iw to build on Fedora 8.
>
> [greearb@fs2 iw]$ git diff
> diff --git a/bitrate.c b/bitrate.c
> index 8de8839..9b6defc 100644
> --- a/bitrate.c
> +++ b/bitrate.c
> @@ -1,4 +1,6 @@
>  #include <errno.h>
> +#define  __USE_ISOC99

This is wrong.  You must never define internal glibc macros.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: Patch to get iw building on Fedora 8
  2010-09-21 19:49 ` Andreas Schwab
@ 2010-09-21 21:09   ` Ben Greear
  2010-09-21 21:34     ` Johannes Stezenbach
  0 siblings, 1 reply; 10+ messages in thread
From: Ben Greear @ 2010-09-21 21:09 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Ben Greear, linux-wireless

On 09/21/2010 12:49 PM, Andreas Schwab wrote:
> Ben Greear<greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>  writes:
>
>> I need this in order to get iw to build on Fedora 8.
>>
>> [greearb@fs2 iw]$ git diff
>> diff --git a/bitrate.c b/bitrate.c
>> index 8de8839..9b6defc 100644
>> --- a/bitrate.c
>> +++ b/bitrate.c
>> @@ -1,4 +1,6 @@
>>   #include<errno.h>
>> +#define  __USE_ISOC99
>
> This is wrong.  You must never define internal glibc macros.

How about this then?

diff --git a/bitrate.c b/bitrate.c
index 8de8839..f0d513f 100644
--- a/bitrate.c
+++ b/bitrate.c
@@ -70,7 +70,7 @@ static int handle_bitrates(struct nl80211_state *state,
  #endif
                 else switch (parser_state) {
                 case S_LEGACY:
-                       tmpf = strtof(argv[i], &end);
+                       tmpf = strtod(argv[i], &end);
                         if (*end != '\0')
                                 return 1;
                         if (tmpf < 1 || tmpf > 255 * 2)

Seems you don't have to do anything clever to get strtod to work,
and I assume it should cast just fine.

Thanks,
Ben

>
> Andreas.
>


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: Patch to get iw building on Fedora 8
  2010-09-21 21:09   ` Ben Greear
@ 2010-09-21 21:34     ` Johannes Stezenbach
  2010-09-22 16:52       ` Ben Greear
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Stezenbach @ 2010-09-21 21:34 UTC (permalink / raw)
  To: Ben Greear; +Cc: Andreas Schwab, linux-wireless

On Tue, Sep 21, 2010 at 02:09:57PM -0700, Ben Greear wrote:
> On 09/21/2010 12:49 PM, Andreas Schwab wrote:
> >Ben Greear<greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>  writes:
> >
> >>I need this in order to get iw to build on Fedora 8.
> >>
...
> >>+#define  __USE_ISOC99
> >
> >This is wrong.  You must never define internal glibc macros.
> 
> How about this then?
...
> -                       tmpf = strtof(argv[i], &end);
> +                       tmpf = strtod(argv[i], &end);
... 
> Seems you don't have to do anything clever to get strtod to work,
> and I assume it should cast just fine.

I think to use C99 features like strtof() you need to either
add -std=c99 to CFLAGS, or #define _ISOC99_SOURCE
(see /usr/include/features.h).

HTH,
Johannes

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

* Re: Patch to get iw building on Fedora 8
  2010-09-21 21:34     ` Johannes Stezenbach
@ 2010-09-22 16:52       ` Ben Greear
  0 siblings, 0 replies; 10+ messages in thread
From: Ben Greear @ 2010-09-22 16:52 UTC (permalink / raw)
  To: Johannes Stezenbach; +Cc: Andreas Schwab, linux-wireless

On 09/21/2010 02:34 PM, Johannes Stezenbach wrote:
> On Tue, Sep 21, 2010 at 02:09:57PM -0700, Ben Greear wrote:
>> On 09/21/2010 12:49 PM, Andreas Schwab wrote:
>>> Ben Greear<greearb-my8/4N5VtI7c+919tysfdA@public.gmane.org>   writes:
>>>
>>>> I need this in order to get iw to build on Fedora 8.
>>>>
> ...
>>>> +#define  __USE_ISOC99
>>>
>>> This is wrong.  You must never define internal glibc macros.
>>
>> How about this then?
> ...
>> -                       tmpf = strtof(argv[i],&end);
>> +                       tmpf = strtod(argv[i],&end);
> ...
>> Seems you don't have to do anything clever to get strtod to work,
>> and I assume it should cast just fine.
>
> I think to use C99 features like strtof() you need to either
> add -std=c99 to CFLAGS, or #define _ISOC99_SOURCE
> (see /usr/include/features.h).

It seems using strtod would be simpler all around, and might work on
more compilers and even more ancient systems.

Thanks,
Ben

>
> HTH,
> Johannes


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: Patch to get iw building on Fedora 8
  2010-09-21 17:28 ` Johannes Berg
@ 2010-09-23 23:05   ` Ben Greear
  2010-09-24  9:31     ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Ben Greear @ 2010-09-23 23:05 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

I notice that you added some code to try to get this working:

#ifndef _ISOC99_SOURCE
#define _ISOC99_SOURCE
#endif


However, it still will not build for me on Fedora 8.  In case I'm doing something
else strange..were you able to build it on FC8 by any chance?

I can easily carry the fix in my own tree, but thought
you might want to know...

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

* Re: Patch to get iw building on Fedora 8
  2010-09-23 23:05   ` Ben Greear
@ 2010-09-24  9:31     ` Johannes Berg
  2010-09-24 13:45       ` Ben Greear
  0 siblings, 1 reply; 10+ messages in thread
From: Johannes Berg @ 2010-09-24  9:31 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless@vger.kernel.org

On Thu, 2010-09-23 at 16:05 -0700, Ben Greear wrote:
> I notice that you added some code to try to get this working:
> 
> #ifndef _ISOC99_SOURCE
> #define _ISOC99_SOURCE
> #endif
> 
> 
> However, it still will not build for me on Fedora 8.  In case I'm doing something
> else strange..were you able to build it on FC8 by any chance?
> 
> I can easily carry the fix in my own tree, but thought
> you might want to know...

No, I don't have FC8 anywhere ... Does it build for you with -std=c99?
But that gives me a lot of warnings due to a libnl header file bug
("extern inline").

johannes


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

* Re: Patch to get iw building on Fedora 8
  2010-09-24  9:31     ` Johannes Berg
@ 2010-09-24 13:45       ` Ben Greear
  2010-09-24 13:58         ` Johannes Berg
  0 siblings, 1 reply; 10+ messages in thread
From: Ben Greear @ 2010-09-24 13:45 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org

On 09/24/2010 02:31 AM, Johannes Berg wrote:
> On Thu, 2010-09-23 at 16:05 -0700, Ben Greear wrote:
>> I notice that you added some code to try to get this working:
>>
>> #ifndef _ISOC99_SOURCE
>> #define _ISOC99_SOURCE
>> #endif
>>
>>
>> However, it still will not build for me on Fedora 8.  In case I'm doing something
>> else strange..were you able to build it on FC8 by any chance?
>>
>> I can easily carry the fix in my own tree, but thought
>> you might want to know...
>
> No, I don't have FC8 anywhere ... Does it build for you with -std=c99?
> But that gives me a lot of warnings due to a libnl header file bug
> ("extern inline").

Any problem with just changing it to 'strtod' ?

That compiles back at least as far as FC5.

Ben

>
> johannes


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com

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

* Re: Patch to get iw building on Fedora 8
  2010-09-24 13:45       ` Ben Greear
@ 2010-09-24 13:58         ` Johannes Berg
  0 siblings, 0 replies; 10+ messages in thread
From: Johannes Berg @ 2010-09-24 13:58 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless@vger.kernel.org

On Fri, 2010-09-24 at 06:45 -0700, Ben Greear wrote:
> On 09/24/2010 02:31 AM, Johannes Berg wrote:
> > On Thu, 2010-09-23 at 16:05 -0700, Ben Greear wrote:
> >> I notice that you added some code to try to get this working:
> >>
> >> #ifndef _ISOC99_SOURCE
> >> #define _ISOC99_SOURCE
> >> #endif
> >>
> >>
> >> However, it still will not build for me on Fedora 8.  In case I'm doing something
> >> else strange..were you able to build it on FC8 by any chance?
> >>
> >> I can easily carry the fix in my own tree, but thought
> >> you might want to know...
> >
> > No, I don't have FC8 anywhere ... Does it build for you with -std=c99?
> > But that gives me a lot of warnings due to a libnl header file bug
> > ("extern inline").
> 
> Any problem with just changing it to 'strtod' ?

I did that earlier today.

johannes


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

end of thread, other threads:[~2010-09-24 13:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-21 16:39 Patch to get iw building on Fedora 8 Ben Greear
2010-09-21 17:28 ` Johannes Berg
2010-09-23 23:05   ` Ben Greear
2010-09-24  9:31     ` Johannes Berg
2010-09-24 13:45       ` Ben Greear
2010-09-24 13:58         ` Johannes Berg
2010-09-21 19:49 ` Andreas Schwab
2010-09-21 21:09   ` Ben Greear
2010-09-21 21:34     ` Johannes Stezenbach
2010-09-22 16:52       ` Ben Greear

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).