Skip to content

Commit

Permalink
Add several GCC attributes that should only be associated with functi…
Browse files Browse the repository at this point in the history
…ons:

leaf, artificial, and warn_unused_result.  These are all heavily used in
<stdio.h> under Fedora 17 (glibc 2.15) when optimization is turned on.
Without this fix, these attributes tend to be incorrectly associated with
functions' return types, which in turn leads to GCC warnings about
incorrect attribute use.
  • Loading branch information
liblit committed May 10, 2012
1 parent 64778b7 commit 0e490af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cil.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1395,7 +1395,9 @@ let attributeHash: (string, attributeClass) H.t =

List.iter (fun a -> H.add table a (AttrFunType false))
[ "format"; "regparm"; "longcall";
"noinline"; "always_inline"; ];
"noinline"; "always_inline"; "leaf";
"artificial"; "warn_unused_result";
];

List.iter (fun a -> H.add table a (AttrFunType true))
[ "stdcall";"cdecl"; "fastcall" ];
Expand Down

0 comments on commit 0e490af

Please sign in to comment.