[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#615525: marked as done (gcc: -Wtype-limits should not trigger for types of implementation-defined signedness)



Your message dated Thu, 3 Jan 2019 17:40:40 -0800
with message-id <20190104014040.GA97188@google.com>
and subject line Re: gcc: -Wtype-limits should not trigger for types of implementation-defined signedness
has caused the Debian Bug report #615525,
regarding gcc: -Wtype-limits should not trigger for types of implementation-defined signedness
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
615525: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=615525
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: gcc-4.6
Version: 4.6-20110216-1
Severity: wishlist
Tags: upstream

Hi,

$ gcc -c -std=gnu99 -Wtype-limits -x c - <<-\EOF
enum test_enum {
	FOO,
	BAR
};

int valid(enum test_enum arg)
{
	return arg >= FOO && arg <= BAR;
}
EOF
<stdin>: In function ‘valid’:
<stdin>:8:9: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
$ 

Since C99 (WG14/N1256 p105, lang.decl.typespec.enum.4) only says:

	Each enumerated type shall be compatible with char, a signed
	integer type, or an unsigned integer type. The choice of type
	is implementation-defined) but shall be capable of
	representing the values of all the members of the enumeration.

the (arg >= FOO) test is not actually redundant.

Thoughts?
Jonathan



--- End Message ---
--- Begin Message ---
As described at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51712,
this is working now.

Thanks for your patient help.
Jonathan

--- End Message ---

Reply to: