public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c/46073] New: __builtin_choose_expr outputs warnings for unused expression @ 2010-10-18 18:57 kevin.waugh at gmail dot com 2010-10-18 19:01 ` [Bug c/46073] " pinskia at gcc dot gnu.org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: kevin.waugh at gmail dot com @ 2010-10-18 18:57 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46073 Summary: __builtin_choose_expr outputs warnings for unused expression Product: gcc Version: 4.0.1 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c AssignedTo: unassigned@gcc.gnu.org ReportedBy: kevin.waugh@gmail.com $ gcc -std=c99 -Wall -x c - << EOF void A(int * p) {} void B(double * p) {} int main() { int * p = 0; __builtin_choose_expr(__builtin_types_compatible_p(__typeof__(p), int *), A(p), B(p)); return 0; } EOF <stdin>: In function ‘main’: <stdin>:5: warning: passing argument 1 of ‘B’ from incompatible pointer type $ gcc -v Using built-in specs. Target: i686-apple-darwin9 Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9 Thread model: posix gcc version 4.0.1 (Apple Inc. build 5493) ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/46073] __builtin_choose_expr outputs warnings for unused expression 2010-10-18 18:57 [Bug c/46073] New: __builtin_choose_expr outputs warnings for unused expression kevin.waugh at gmail dot com @ 2010-10-18 19:01 ` pinskia at gcc dot gnu.org 2010-10-18 19:17 ` kevin.waugh at gmail dot com 2010-10-18 19:55 ` joseph at codesourcery dot com 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2010-10-18 19:01 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46073 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-18 19:00:51 UTC --- I think this is correct as __builtin_choose_expr still does semantically checking on the two arguments. Not to mention __builtin_choose_expr was added only to support Altivec intrinsics and that has since been moved away from that. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/46073] __builtin_choose_expr outputs warnings for unused expression 2010-10-18 18:57 [Bug c/46073] New: __builtin_choose_expr outputs warnings for unused expression kevin.waugh at gmail dot com 2010-10-18 19:01 ` [Bug c/46073] " pinskia at gcc dot gnu.org @ 2010-10-18 19:17 ` kevin.waugh at gmail dot com 2010-10-18 19:55 ` joseph at codesourcery dot com 2 siblings, 0 replies; 4+ messages in thread From: kevin.waugh at gmail dot com @ 2010-10-18 19:17 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46073 --- Comment #2 from kevin.waugh at gmail dot com 2010-10-18 19:17:17 UTC --- (In reply to comment #1) > I think this is correct as __builtin_choose_expr still does semantically > checking on the two arguments. Not to mention __builtin_choose_expr was added > only to support Altivec intrinsics and that has since been moved away from > that. >From the documentation: Note: This construct is only available for C. Furthermore, the unused expression (exp1 or exp2 depending on the value of const_exp) may still generate syntax errors. This may change in future revisions. What are the chances of getting this changed, or having an option to suppress warnings on the unevaluated argument? The implementation of tgmath.h is essentially using __builtin_choose_expr for the same purpose, but it appers to avoid any warnings/errors because of implicit casts. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/46073] __builtin_choose_expr outputs warnings for unused expression 2010-10-18 18:57 [Bug c/46073] New: __builtin_choose_expr outputs warnings for unused expression kevin.waugh at gmail dot com 2010-10-18 19:01 ` [Bug c/46073] " pinskia at gcc dot gnu.org 2010-10-18 19:17 ` kevin.waugh at gmail dot com @ 2010-10-18 19:55 ` joseph at codesourcery dot com 2 siblings, 0 replies; 4+ messages in thread From: joseph at codesourcery dot com @ 2010-10-18 19:55 UTC (permalink / raw) To: gcc-bugs http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46073 --- Comment #3 from joseph at codesourcery dot com <joseph at codesourcery dot com> 2010-10-18 19:55:25 UTC --- On Mon, 18 Oct 2010, pinskia at gcc dot gnu.org wrote: > checking on the two arguments. Not to mention __builtin_choose_expr was added > only to support Altivec intrinsics and that has since been moved away from > that. When C1X _Generic is implemented that will have similar issues. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-10-18 19:55 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2010-10-18 18:57 [Bug c/46073] New: __builtin_choose_expr outputs warnings for unused expression kevin.waugh at gmail dot com 2010-10-18 19:01 ` [Bug c/46073] " pinskia at gcc dot gnu.org 2010-10-18 19:17 ` kevin.waugh at gmail dot com 2010-10-18 19:55 ` joseph at codesourcery dot com
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).