[cfe-dev] Can clang parse the Linux kernel?

Roberto Bagnara bagnara at cs.unipr.it
Fri Dec 19 13:10:29 PST 2008


Trying to answer this question, I had a go at Linux 2.6.27.10.
I did not go very far, as make stopped because of the following:

$ clang -w modpost.i
modpost.i:6067:28: error: used type '_Elf64_Mips_R_Info_union' where arithmetic or pointer type is required
    r_sym = ((__extension__ (_Elf64_Mips_R_Info_union)(rela->r_info)).r_info_fields.r_sym);
                            ^                         ~~~~~~~~~~~~~~
modpost.i:6069:28: error: used type '_Elf64_Mips_R_Info_union' where arithmetic or pointer type is required
    r_typ = ((__extension__ (_Elf64_Mips_R_Info_union)(rela->r_info)).r_info_fields.r_type1);
                            ^                         ~~~~~~~~~~~~~~
modpost.i:6111:28: error: used type '_Elf64_Mips_R_Info_union' where arithmetic or pointer type is required
    r_sym = ((__extension__ (_Elf64_Mips_R_Info_union)(rel->r_info)).r_info_fields.r_sym);
                            ^                         ~~~~~~~~~~~~~
modpost.i:6113:28: error: used type '_Elf64_Mips_R_Info_union' where arithmetic or pointer type is required
    r_typ = ((__extension__ (_Elf64_Mips_R_Info_union)(rel->r_info)).r_info_fields.r_type1);
                            ^                         ~~~~~~~~~~~~~
4 diagnostics generated.
$

Should I file bug reports for such problems?
All the best,

    Roberto

-- 
Prof. Roberto Bagnara
Computer Science Group
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:bagnara at cs.unipr.it



More information about the cfe-dev mailing list