>Number: 185431 >Category: bin >Synopsis: gcc bug with short int promotion >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 03 01:50:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Stephen Hurd >Release: 9.1-RELEASE-p6 >Organization: >Environment: FreeBSD cracked.hurd.local 9.1-RELEASE-p6 FreeBSD 9.1-RELEASE-p6 #0: Wed Aug 21 20:30:17 UTC 2013 r...@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386
>Description: Integer promotion of a short int and an unsigned short in the same expression seems broken in the system compiler. >How-To-Repeat: #include <stdio.h> int main(int argc, char **argv) { short k = 251; unsigned short l = 65535; printf("%hd > %hu = %d\n", k, l, (k > l)); return 0; } > gcc test.c > ./a.out 251 > 65535 = 1 >Fix: Use a different compiler. >Release-Note: >Audit-Trail: >Unformatted: _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"