[cfe-dev] const stripped in typedefs for parameters of primitive type?
dblaikie at gmail.com
Sat Aug 23 13:42:09 PDT 2014
This is how C behaves - the const has no effect on the function type there
On Aug 23, 2014 4:04 AM, "Jacob Carlborg" <doob at me.com> wrote:
> I have a tool that does some processing on C code using libclang. I
> recently found out that it seems libclang strips const in typedefs for
> parameters of primitive type. Example:
> typedef void (*foo)(const char* a, const int b);
> void (*bar)const char* c, const int d);
> According libclang, in "foo", "a" is const but "b" is not const. But in
> "bar", both "c" and "d" are const.
> Is this how C behaves, or have I made an mistake how the tool handles
> typedefs. Or is this a bug in libclang?
> I have tried with both libclang 3.1 and 3.5-rc3
> /Jacob Carlborg
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev