I get the below mentioned errors on compiling the attached file with clang.
I have installed clang on a x86-64 machine (intel xeon core 2 duo
2.66ghz) running Suse linux for X86-64 with kernel 2.6.18.8-0.9
The same program is handled by clang without error messages on the
same machine running 32bit linux with the same kernel.
------------------------------------------------
In file included from memcopy.c:2:
/usr/include/stdio.h:34:11: error: 'stddef.h' file not found
# include <stddef.h>
^
In file included from memcopy.c:2:
In file included from /usr/include/stdio.h:36:
/usr/include/bits/types.h:31:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:2:
In file included from /usr/include/stdio.h:72:
In file included from /usr/include/libio.h:32:
/usr/include/_G_config.h:14:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:2:
In file included from /usr/include/stdio.h:72:
In file included from /usr/include/libio.h:32:
In file included from /usr/include/_G_config.h:24:
/usr/include/wchar.h:48:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:2:
In file included from /usr/include/stdio.h:72:
In file included from /usr/include/libio.h:32:
In file included from /usr/include/_G_config.h:44:
In file included from /usr/include/gconv.h:28:
/usr/include/wchar.h:48:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:2:
In file included from /usr/include/stdio.h:72:
In file included from /usr/include/libio.h:32:
In file included from /usr/include/_G_config.h:44:
/usr/include/gconv.h:31:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:2:
In file included from /usr/include/stdio.h:72:
/usr/include/libio.h:53:11: error: 'stdarg.h' file not found
# include <stdarg.h>
^
In file included from memcopy.c:3:
/usr/include/stdlib.h:33:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:3:
In file included from /usr/include/stdlib.h:438:
/usr/include/sys/types.h:147:10: error: 'stddef.h' file not found
#include <stddef.h>
^
In file included from memcopy.c:3:
In file included from /usr/include/stdlib.h:612:
/usr/include/alloca.h:25:10: error: 'stddef.h' file not found
#include <stddef.h>
^
10 diagnostics generated.
--
Santosh G Nagarakatte,
#include<stdio.h>
#include<stdlib.h>
#include<sys/time.h>
int test(unsigned long int mm)
{
int value;
struct timeval start;
struct timeval end;
unsigned long int t1;
int i=0,j;
int arr1[100];
int arr2[100];
for(j=0;j<100;j++)
arr1[j]= rand()%1000;
gettimeofday(&start,NULL);
int *ptr1;
int *ptr2;
ptr1=arr1;
ptr2=arr2;
for(j=0;j<mm;j++)
{
i=0;
ptr1=arr1;
ptr2=arr2;
while(i<100)
{
//printf("%d\n",i);
if( mm%100== i)
{
value+= *(ptr1);
}
*ptr2=*ptr1;
ptr2++;
ptr1++;
i++;
}
}
gettimeofday(&end,NULL);
t1 =(end.tv_sec -start.tv_sec)*1000000 + (end.tv_usec - start.tv_usec);
printf("%ld:%ld\n",t1, value);
for(j=0;j<100;j++)
{
if(arr1[j]!=arr2[j])
printf("error");
}
}
int main(int argc, char * argv[])
{
unsigned long int mm;
mm=atoi(argv[1]);
//printf("%ld\n",mm);
test(mm);
}
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev