public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Yesterday's testcases
@ 2001-11-11  6:03 Neil Booth
  2001-11-11  9:41 ` Joseph S. Myers
  0 siblings, 1 reply; 2+ messages in thread
From: Neil Booth @ 2001-11-11  6:03 UTC (permalink / raw)
  To: gcc; +Cc: Joseph S. Myers

Joseph,

Yesterday you submitted 2 integer testcases (I can't reply to your
mail since my ISP appears to have managed to lose over 12 hrs of
incoming e-mail).

The cases contained:

/* (T *) if E is zero, (void *) otherwise.  */
#define type_if_not(T, E) __typeof__(0 ? (T *)0 : (void *)(E))

Is this not a typo?  That looks equivalent to

#define type_if_not(T, E) __typeof__((void *)(E))

and

#define type_if_not(T, E) (void *)

which doesn't depend on T or E.

Neil.

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

* Re: Yesterday's testcases
  2001-11-11  6:03 Yesterday's testcases Neil Booth
@ 2001-11-11  9:41 ` Joseph S. Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph S. Myers @ 2001-11-11  9:41 UTC (permalink / raw)
  To: Neil Booth; +Cc: gcc

On Wed, 21 Nov 2001, Neil Booth wrote:

> Is this not a typo?  That looks equivalent to

The type of a conditional expression between pointer types depends on
whether one side is a null pointer constant, see C99 6.5.15#6.  This is
the same principle used in current glibc's <tgmath.h> (to which Ulrich
helpfully added to my definitions of __floating_type,
__tgmath_real_type_sub and __tgmath_real_type the comment

/* This is ugly but unless gcc gets appropriate builtins we have to do
   something like this.  Don't ask how it works.  */

).

-- 
Joseph S. Myers
jsm28@cam.ac.uk

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

end of thread, other threads:[~2001-11-21 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-11  6:03 Yesterday's testcases Neil Booth
2001-11-11  9:41 ` Joseph S. Myers

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