2017-09-07 2 views
0

Ich traf einen sehr seltsamen Fehler beim Kompilieren meines Codes mit Clang.seltsame Kompilierung Fehler über pthreadtypes.h: 'Abschnitt' Attribut

hier ist mein Befehl

$clang -c -emit-llvm -I/OP-TEE/op-tee-os/optee_os/lib/libutee/include/ -I/OP-TEE/op-tee-os/optee_os/lib/libutils/ext/include/ test_function_call_ta.c 

und hier ist der Fehler:

In file included from /usr/include/stdlib.h:314: 
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:270: 
/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:200:5: error: 'section' attribute only applies to functions, methods, 
     properties, and global variables 
    } __data; 
    ^
/opensource_projects/OP-TEE/op-tee-os/optee_os/lib/libutils/ext/include/compiler.h:51:17: note: expanded 
     from macro '__data' 
#define __data   __section(".data") 
         ^
/opensource_projects/OP-TEE/op-tee-os/optee_os/lib/libutils/ext/include/compiler.h:50:37: note: expanded 
     from macro '__section' 
#define __section(x) __attribute__((section(x))) 

Ich habe mich gefragt, warum dieser Fehler passiert, weil ich nicht Abschnitt Attribute im Quelltext verwendet haben.

Vielen Dank im Voraus!

Antwort

0

Schließlich habe ich dieses Problem behoben. Der Grund ist, dass ich eine falsche Headerdatei mit "-I" importiere. Die richtige sollte in einem anderen Ordner ...