Re: libkern/quad.h

2002-04-10 Thread David O'Brien

On Tue, Apr 09, 2002 at 04:58:42PM +0200, Alexander Leidinger wrote:
 quad.h contains:
 ---snip---
 /*
  * XXX
  * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
  * as u_quad_t, while gcc 2 correctly uses int.  Unfortunately, we still use
  * both compilers.
  */
 #if __GNUC__ = 2
 typedef unsigned intqshift_t;
 #else
 typedef u_quad_tqshift_t;
 #endif
 ---snip---
 
 Is this still valid? Does someone really use gcc 1 to compile FreeBSD?

I assume your question stems from trying to use icc.  Please wrap this
bit [semi]-properly with:

#ifdef __GNUC__
#if __GNUC__ = 2
typedef unsigned intqshift_t;
#else
typedef u_quad_tqshift_t;
#endif
#endif

You can then put a defintion for #ifdef __IC

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: libkern/quad.h

2002-04-10 Thread Bruce Evans

On Tue, 9 Apr 2002, Alexander Leidinger wrote:

 quad.h contains:
 ---snip---
 /*
  * XXX
  * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
  * as u_quad_t, while gcc 2 correctly uses int.  Unfortunately, we still use
  * both compilers.
  */
 #if __GNUC__ = 2
 typedef unsigned intqshift_t;
 #else
 typedef u_quad_tqshift_t;
 #endif
 ---snip---

 Is this still valid? Does someone really use gcc 1 to compile FreeBSD?

This became invalid before FreeBSD-2.0 was released.

Most special cases to support gcc's before approx 2.7 are now bogus.
Unlike the above, most of them are just for optimizations or for better
diagnostics, so removing them shouldn't break compiling with old versions
of gcc any more than not having the for other C compilers breaks compiling
with other C compilers.

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: libkern/quad.h

2002-04-10 Thread Alexander Leidinger

On 10 Apr, Bruce Evans wrote:

  * XXX
  * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
  * as u_quad_t, while gcc 2 correctly uses int.  Unfortunately, we still use
  * both compilers.

 Is this still valid? Does someone really use gcc 1 to compile FreeBSD?
 
 This became invalid before FreeBSD-2.0 was released.
 
 Most special cases to support gcc's before approx 2.7 are now bogus.
 Unlike the above, most of them are just for optimizations or for better
 diagnostics, so removing them shouldn't break compiling with old versions
 of gcc any more than not having the for other C compilers breaks compiling
 with other C compilers.

Thank you, I will remove them in my icc patches.

Bye,
Alexander.

-- 
Secret hacker rule #11: hackers read manuals.

http://www.Leidinger.net   Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: libkern/quad.h

2002-04-10 Thread Alexander Leidinger

On 10 Apr, David O'Brien wrote:
 On Tue, Apr 09, 2002 at 04:58:42PM +0200, Alexander Leidinger wrote:
 quad.h contains:
 ---snip---
 /*
  * XXX
  * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
  * as u_quad_t, while gcc 2 correctly uses int.  Unfortunately, we still use
  * both compilers.
  */
 #if __GNUC__ = 2
 typedef unsigned intqshift_t;
 #else
 typedef u_quad_tqshift_t;
 #endif
 ---snip---
 
 Is this still valid? Does someone really use gcc 1 to compile FreeBSD?
 
 I assume your question stems from trying to use icc.  Please wrap this
 bit [semi]-properly with:
 
 #ifdef __GNUC__
 #if __GNUC__ = 2
 typedef unsigned intqshift_t;
 #else
 typedef u_quad_tqshift_t;
 #endif
 #endif
 
 You can then put a defintion for #ifdef __IC
 

Fullquote because your message seems to be truncated...

Yes, your assumption is correct. And BDE already said this particular
example became invalid before FreeBSD-2.0. I think it is ok to remove
this particular example entirely and just use the first typedef.

As for other occourences of the use of __GNUC__ without a check if it is
defined: I will wrap them as soon as I review my own patches again.

Bye,
Alexander.

P.S.: Any news on the icc - linux_base issue?
-- 
   Intel: where Quality is job number 0.9998782345!

http://www.Leidinger.net   Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: libkern/quad.h

2002-04-10 Thread Bruce Evans

On Wed, 10 Apr 2002, Alexander Leidinger wrote:

 As for other occourences of the use of __GNUC__ without a check if it is
 defined: I will wrap them as soon as I review my own patches again.

Other occurrences are mostly correct.  __GNUC__ is 0 in cpp expressions
if it is used without it being defined.  The problem with the ifdef in
quad.h is that it defaults to the gcc-1 case if __GNUC__ is not = 2.
The ifdef should have been written something like:

#if __GNUC__ == 1
typedef u_quad_tqshift_t;
#else
typedef u_int   qshift_t;
#endif

assuming that u_int really is correct for shift counts.  (Shift counts
can be of any integer type; it is just not useful to use a large type
for them since shifting by an amount larger than the number of bits in
the operand being shifted is undefined.)

Bruce


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



libkern/quad.h

2002-04-09 Thread Alexander Leidinger

Hi,

quad.h contains:
---snip---
/*
 * XXX
 * Compensate for gcc 1 vs gcc 2.  Gcc 1 defines ?sh?di3's second argument
 * as u_quad_t, while gcc 2 correctly uses int.  Unfortunately, we still use
 * both compilers.
 */
#if __GNUC__ = 2
typedef unsigned intqshift_t;
#else
typedef u_quad_tqshift_t;
#endif
---snip---

Is this still valid? Does someone really use gcc 1 to compile FreeBSD?

Bye,
Alexander.

-- 
  Weird enough for government work.

http://www.Leidinger.net   Alexander @ Leidinger.net
  GPG fingerprint = C518 BC70 E67F 143F BE91  3365 79E2 9C60 B006 3FE7


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message