public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/10036: new keyword "boolif" that accepts only <stdbool.h>bool values "true" or "false" as arguments; comparison operators that return <stdbool.h>bool values.
@ 2003-03-22  4:26 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2003-03-22  4:26 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, roland.illig

Synopsis: new keyword "boolif" that accepts only <stdbool.h>bool values "true" or "false" as arguments; comparison operators that return <stdbool.h>bool values.

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Sat Mar 22 04:26:01 2003
State-Changed-Why:
    As desirable as this might be, I don't see any chance of this
    being implemented. The standards provide default conversions
    between integers and booleans, which would have to be
    abandoned temporarily if inside if-statements. I cannot
    imagine that people will want to work on this inside gcc
    any time soon, so can't see a value in keeping this report
    open.
    
    Sorry
      Wolfgang

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10036


^ permalink raw reply	[flat|nested] 2+ messages in thread

* c/10036: new keyword "boolif" that accepts only <stdbool.h>bool values "true" or "false" as arguments; comparison operators that return <stdbool.h>bool values.
@ 2003-03-12 10:26 roland.illig
  0 siblings, 0 replies; 2+ messages in thread
From: roland.illig @ 2003-03-12 10:26 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10036
>Category:       c
>Synopsis:       new keyword "boolif" that accepts only <stdbool.h>bool values "true" or "false" as arguments; comparison operators that return <stdbool.h>bool values.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 12 10:26:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     roland.illig@gmx.de
>Release:        unknown-1.0
>Organization:
>Environment:
any
>Description:
#include <stdbool.h>

/* let === be an equality operator whose type is (any,any)->bool. */

int main(void)
{
	int a = 12345;
	int b = -12345;

	boolif (a - b === 0) {
		printf("ok\n");
	} else {
		printf("not ok\n");
	}

	boolif (a) { /* this shall lead to a compiler error */
		printf("12345 == true\n");
	} else {
		printf("12345 != true\n");
	}
}

The strict-bool type shall have no implicit conversion rules from or to other types. The only way to get a strict-bool is the application of the strict-bool operators.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-22  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-22  4:26 c/10036: new keyword "boolif" that accepts only <stdbool.h>bool values "true" or "false" as arguments; comparison operators that return <stdbool.h>bool values bangerth
  -- strict thread matches above, loose matches on Subject: below --
2003-03-12 10:26 roland.illig

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).