[ccan] cpuid problems...

Rusty Russell rusty at rustcorp.com.au
Sun Dec 1 21:14:41 EST 2013


Ahmed Samy <f.fallen45 at gmail.com> writes:
> Hi!
>
> Sorry for that..  I'm not quite sure if ccanlint has some special way of
> dealing with the tests, but I always compile and run to make sure
> everything is fine before pushing my commits.

It's the example which fails, BTW:

$ ccanlint ccan/cpuid
cpuid: Module examples compile (examples_compile): FAIL (+1/2)
/tmp/user/1000/ccanlint-24228.1804289383/example-_info-cpuid.c:Standalone compile and adding headers both failed
cpuid: Total score: 32/42

$ ccanlint -v ccan/cpuid -t examples_compile
cpuid: _info and main header file have Example: sections (examples_exist): PASS (+1/2)
/home/rusty/devel/cvs/ccan/ccan/cpuid/cpuid.h:No Example: section
cpuid: Module examples compile (examples_compile): FAIL (+1/2)
/tmp/user/1000/ccanlint-24617.1804289383/example-_info-cpuid.c:Standalone example:
#line 10 "/home/rusty/devel/cvs/ccan/ccan/cpuid/_info"
#include <ccan/cpuid/cpuid.h>
#include <stdio.h>

int main(void)
{
     uint32_t highest;
     cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &highest);
     printf ("Highest extended function supported: %d\n", highest);

     return 0;
}

Errors: /home/rusty/devel/cvs/ccan/ccan/cpuid/_info: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/cpuid/_info:16:12: error: ‘CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED’ undeclared (first use in this function)
/home/rusty/devel/cvs/ccan/ccan/cpuid/_info:16:12: note: each undeclared identifier is reported only once for each function it appears in


Adding headers, wrappers:
/* Include header from module. */
#include <ccan/cpuid/cpuid.h>
/* Prepend a heap of headers. */
#include <assert.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
/* Useful dummy functions. */
extern int somefunc(void);
int somefunc(void) { return 0; }
extern char somestring[];
char somestring[] = "hello world";
/* The example starts with #include, so didn't wrap in main() */
#line 10 "/home/rusty/devel/cvs/ccan/ccan/cpuid/_info"
#include <ccan/cpuid/cpuid.h>
#include <stdio.h>

int main(void)
{
     uint32_t highest;
     cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &highest);
     printf ("Highest extended function supported: %d\n", highest);

     return 0;
}

Errors: /home/rusty/devel/cvs/ccan/ccan/cpuid/_info: In function ‘main’:
/home/rusty/devel/cvs/ccan/ccan/cpuid/_info:16:12: error: ‘CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED’ undeclared (first use in this function)
/home/rusty/devel/cvs/ccan/ccan/cpuid/_info:16:12: note: each undeclared identifier is reported only once for each function it appears in



cpuid: Total score: 7/9

>
> Anyway, I'll compile ccanlint and use that one instead.
>
> Thanks,
> Ahmed
>
>
> On Tue, Nov 12, 2013 at 12:44 PM, Rusty Russell <rusty at rustcorp.com.au>wrote:
>
>> Hi Ahmed,
>>
>>         You broke ccan/cpuid *again*:
>>
>> rusty at rusty-ThinkPad-X201:~/devel/cvs/ccan (7cc2462...)$ ccanlint
>> ccan/cpuid
>> cpuid: Module examples compile (examples_compile): FAIL (+1/2)
>> /tmp/user/1000/ccanlint-15606.1804289383/example-_info-cpuid.c:Standalone
>> compile and adding headers both failed
>> cpuid: Total score: 32/42
>>
>> I suggest you build ccanlint, and run it before checkin!
>>
>> Thanks,
>> Rusty.
>>


More information about the ccan mailing list