[cfe-dev] Feature request: C intrinsics for overflow detection
Alp Toker
alp at nuanti.com
Fri May 9 17:32:41 PDT 2014
On 09/05/2014 23:05, Richard Smith wrote:
> On Fri, May 9, 2014 at 10:55 AM, Reid Kleckner <rnk at google.com
> <mailto:rnk at google.com>> wrote:
>
> They are exposed:
> http://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins
>
> ... but that's not indexed by Google. Maybe this is the problem?
> http://clang.llvm.org/robots.txt:
> User-agent: *
> Disallow:
>
>
> That's an 'allow everything' robots.txt. The results are there; try
> searching for: "__builtin_uadd_overflow" clang
I've found Bing yields *far* better results for compiler-related
technical searches. Definitely worth changing habits and checking out
for a few days:
http://www.bing.com/search?q=builtin_uadd_overflow (54 results)
https://www.google.com/#q=builtin_uadd_overflow (0 results)
I'm not sure why but Google search seems to expect an exact match for
many of the constructs one encounters in C and C++ so you rarely get
pertinent results. I was talking with a Google search engineer and they
said their focus is on the most popular consumer searches so perhaps
that's the reason.
Cheers
Alp.
> On Fri, May 9, 2014 at 10:27 AM, Andy Lutomirski
> <luto at amacapital.net <mailto:luto at amacapital.net>> wrote:
>
> LLVM has the llvm.*.with.overflow.* intrinsics. Can these be
> exposed
> to C code? I imagine this would be straightforward, aside
> from the
> obligatory bikeshedding about exactly what the interface
> should be.
>
> This would eliminate a lot of nasty hacks used to check for
> overflow,
> especially for multiplication overflow. I currently write
> this stuff
> in inline x86 assembler -- ugh! And maybe gcc would go along
> if clang
> paved the way :)
>
> --Andy
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu <mailto:cfe-dev at cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
--
http://www.nuanti.com
the browser experts
More information about the cfe-dev
mailing list