mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@suse.de>
To: Steve French <smfrench@austin.rr.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Compiling kernel with SuSE 8.2/gcc 3.3
Date: Wed, 11 Jun 2003 18:12:04 +0200	[thread overview]
Message-ID: <jeu1awzj8r.fsf@sykes.suse.de> (raw)
In-Reply-To: <3EE6B7A2.3000606@austin.rr.com> (Steve French's message of "Wed, 11 Jun 2003 00:01:22 -0500")

Steve French <smfrench@austin.rr.com> writes:

|> I also noticed lots of compiler warnings with gcc 3.3, now default in
|> SuSE, and cleaned up most of them for the cifs vfs but there are a few
|> that just
|> look wrong for gcc to spit out warnings on.   For example the following
|> local variable definition and the similar ones in the same file
|> (fs/cifs/inode.c):
|> 
|> 	__u64 uid = 0xFFFFFFFFFFFFFFFF;
|> 
|> generates a warning saying the value is too long for a long on x86 SuSE
|> 8.2 with gcc 3.3 - which makes no sense.  Any value
|> above 0xFFFFFFFFF generates the same warning (intuitively
|> 36 bits should fit in an unsigned 64 bit local variable).

An expression is evaluated independent of the context, ie. the fact that
the left side of the assignment is a 64 bit variable has no significance
at all.  But I agree that the warning should only occur in c89 mode, not
in the default gnu89 mode, where long long is available.  And in fact the
generated code will be correct.

|> Defining the literal with the UL suffix didn't seem to help

Yes, since you need a long long literal.

|> rebelled against the solutions that work for this case ie casting the
|> local variable which is already __u64 to __u64 but that presumably would
|> work for those three, as would a (__u64)cast of -1 which seems equally
|> ugly).

You can just use -1.  The implicit conversion to __u64 will DTRT.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  parent reply	other threads:[~2003-06-11 15:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-11  5:01 Steve French
2003-06-11 11:20 ` Richard B. Johnson
2003-06-11 13:59   ` Richard B. Johnson
2003-06-11 11:28 ` Matthias Andree
2003-06-11 16:12 ` Andreas Schwab [this message]
     [not found] <3EE6B7A2.3000606@austin.rr.com.suse.lists.linux.kernel>
2003-06-11  8:01 ` Andi Kleen
2003-06-12  1:24   ` Steve French
2003-06-12  1:40     ` Andrew Morton
2003-06-12  2:17       ` Riley Williams
2003-06-12  2:00     ` Linus Torvalds
2003-06-12 12:52     ` Horst von Brand
     [not found] <20030408134240.45cdad7e.skraw@ithnet.com.suse.lists.linux.kernel>
2003-04-08 13:14 ` Andi Kleen
     [not found] <20030408115008$0cd2@gated-at.bofh.it>
2003-04-08 12:02 ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2003-04-08 11:42 Stephan von Krawczynski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jeu1awzj8r.fsf@sykes.suse.de \
    --to=schwab@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=smfrench@austin.rr.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®