[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-dev
Subject:    Re: [cfe-dev] incompatible redeclaration of library function
From:       Eli Friedman <eli.friedman () gmail ! com>
Date:       2009-06-30 23:22:36
Message-ID: f5aa3e9b0906301622o248641ah94e681eec105c296 () mail ! gmail ! com
[Download RAW message or body]

On Tue, Jun 30, 2009 at 8:26 AM, Henrique Almeida<hdante@gmail.com> wrote:
>  This is almost good to me, however there are some parts of the
> library (ie, in printf) that require the use of the equivalent signed
> version of size_t (for example, to print the argument "%zd"). Is there
> a way to get this in clang ? Else, I'll have to define size_t in per
> case basis. Same for ptrdiff_t.

Ah... that's kind of messy.  If you make the assumption that size_t
and ptrdiff_t are either short, int, long, or long long, you can
probably pull it off with a combination of typeof,
__builtin_choose_expr, and __builtin_types_compatible_p.

>  Also, what's the expected behavior of redefining a built-in function ?

Redeclaring a built-in function with a compatible prototype is okay.
If you need to define library functions, you should pass in
-fno-builtin on the command-line.

-Eli

_______________________________________________
cfe-dev mailing list
cfe-dev@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic