Pedro Izecksohn [EMAIL PROTECTED] wrote:
... If I would write the C standard, or I would make
restrictions to use true or I would not declare it at all
and leave it being any non zero.
But this is my actual position: Ten days ago I thought
the current true definition a good thing. Until
if (i==b)
If you're suggesting this should be an error, then
should the following be an error also?
struct
{
unsigned flag1 : 1;
unsigned flag2 : 1;
} x;
if (x.flag1 == true)
If I would write the C standard, or I would make restrictions to use true
or I would not declare
Pedro Izecksohn [EMAIL PROTECTED] wrote:
Peternilsson42 replied:
Pedro Izecksohn wrote:
If any value not zero is true why true which expands to
the integer constant 1?
How can a macro expand to multiple values? That's the
problem.
#define true (_Bool)1
#define true
Hi,
Reply embedded.
--- In c-prog@yahoogroups.com, Shyan Lam [EMAIL PROTECTED] wrote:
-Original Message-
From: c-prog@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Pedro Izecksohn
Sent: Saturday, May 26, 2007 10:15 PM
If any value not zero is true why true which
Pedro Izecksohn [EMAIL PROTECTED] wrote:
If any value not zero is true why true which expands to the
integer constant 1?
How can a macro expand to multiple values? That's the problem.
Note that C is not the only language with the difficulty.
In Pascal (IIRC) and many Basics, it's the least
Saurabh Jain asked:
are you sure xy == xy???
Am I missing something?
Pedro's reply:
Shyan Lam, thinking that I mistyped, meant that:
if ((x y) == true)
may be shortened to:
if (x y)
But my bug was to think that:
if (xy)
is equivalent to:
if ((xy)==true)
Pedro Izecksohn wrote:
Saurabh Jain asked:
are you sure xy == xy???
Am I missing something?
Pedro's reply:
Shyan Lam, thinking that I mistyped, meant that:
if ((x y) == true)
may be shortened to:
if (x y)
But my bug was to think that:
if (xy)
is
I wrote:
Peternilsson42 replied:
If any value not zero is true why true which expands to the
integer constant 1?
How can a macro expand to multiple values? That's the problem.
#define true (_Bool)1
And:
int i=5;
_Bool b=true;
if (i==b) // should generate a warning.