Patchwork FreeBSD ppc_init_cacheline_sizes(): add missing #includes

login
register
mail settings
Submitter Juergen Lock
Date March 12, 2010, 9:50 p.m.
Message ID <20100312215015.GA29285@triton8.kn-bremen.de>
Download mbox | patch
Permalink /patch/47700/
State New
Headers show

Comments

Juergen Lock - March 12, 2010, 9:50 p.m.
This fixes commit e4ee916d3f9a93df06bd498c92767c1558d59a0b.
(The bug was mine actually...)

Submitted by: Andreas Tobler <andreast@fgznet.ch>

Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
malc - March 12, 2010, 9:59 p.m.
On Fri, 12 Mar 2010, Juergen Lock wrote:

> This fixes commit e4ee916d3f9a93df06bd498c92767c1558d59a0b.
> (The bug was mine actually...)
> 
> Submitted by: Andreas Tobler <andreast@fgznet.ch>
> 
> Signed-off-by: Juergen Lock <nox@jelal.kn-bremen.de>
> 
> --- a/cache-utils.c
> +++ b/cache-utils.c
> @@ -58,7 +58,10 @@ static void ppc_init_cacheline_sizes(voi
>  #endif
>  
>  #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> +#include <errno.h>
>  #include <stdio.h>
> +#include <stdlib.h>

And stdlib is needed for what exactly?

> +#include <string.h>
>  #include <sys/types.h>
>  #include <sys/sysctl.h>
>  
> 
>
Andreas Tobler - March 12, 2010, 10:07 p.m.
On 12.03.10 22:59, malc wrote:
> On Fri, 12 Mar 2010, Juergen Lock wrote:
>
>> This fixes commit e4ee916d3f9a93df06bd498c92767c1558d59a0b.
>> (The bug was mine actually...)
>>
>> Submitted by: Andreas Tobler<andreast@fgznet.ch>
>>
>> Signed-off-by: Juergen Lock<nox@jelal.kn-bremen.de>
>>
>> --- a/cache-utils.c
>> +++ b/cache-utils.c
>> @@ -58,7 +58,10 @@ static void ppc_init_cacheline_sizes(voi
>>   #endif
>>
>>   #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
>> +#include<errno.h>
>>   #include<stdio.h>
>> +#include<stdlib.h>
>
> And stdlib is needed for what exactly?

To avoid this one:

cache-utils.c: In function 'ppc_init_cacheline_sizes':
cache-utils.c:76: warning: implicit declaration of function 'exit'

Andreas
malc - March 12, 2010, 10:13 p.m.
On Fri, 12 Mar 2010, Andreas Tobler wrote:

> On 12.03.10 22:59, malc wrote:
> > On Fri, 12 Mar 2010, Juergen Lock wrote:
> > 
> > > This fixes commit e4ee916d3f9a93df06bd498c92767c1558d59a0b.
> > > (The bug was mine actually...)
> > > 
> > > Submitted by: Andreas Tobler<andreast@fgznet.ch>
> > > 
> > > Signed-off-by: Juergen Lock<nox@jelal.kn-bremen.de>
> > > 
> > > --- a/cache-utils.c
> > > +++ b/cache-utils.c
> > > @@ -58,7 +58,10 @@ static void ppc_init_cacheline_sizes(voi
> > >   #endif
> > > 
> > >   #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> > > +#include<errno.h>
> > >   #include<stdio.h>
> > > +#include<stdlib.h>
> > 
> > And stdlib is needed for what exactly?
> 
> To avoid this one:
> 
> cache-utils.c: In function 'ppc_init_cacheline_sizes':
> cache-utils.c:76: warning: implicit declaration of function 'exit'

Ok, right you are.

Patch

--- a/cache-utils.c
+++ b/cache-utils.c
@@ -58,7 +58,10 @@  static void ppc_init_cacheline_sizes(voi
 #endif
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <sys/sysctl.h>