From: Bruce Korb <bkorb@veritas.com>
Cc: guile-devel@gnu.org
Subject: Re: Compiling 1.7.0 with gcc-3.3
Date: Mon, 19 May 2003 09:20:45 -0700 [thread overview]
Message-ID: <3EC9045D.E8712F62@veritas.com> (raw)
In-Reply-To: E19Hhab-0000es-00@witch
Mikael Djurfeldt wrote:
>
> I've tried to compile CVS HEAD (1.7.0) with gcc-3.3.
>
> Of course, I'd like this to work with the default
> --enable-error-on-warning. However, there are two problematic
> instances. One is the use of SCM_STACKITEM. For example:
>
> eval.c:1965:
> if (scm_stack_checking_enabled_p
> && SCM_STACK_OVERFLOW_P ((SCM_STACKITEM *) &proc))
>
> The cast into (SCM_STACKITEM *) causes a warning that the pointer can
> cause errors due to aliasing optimizations if it is dereferenced
> (which it isn't, BTW). -fstrict-aliasing is turned on by -O2 in
> gcc-3.3.
Cast it through a void* cast:
> eval.c:1965:
> if (scm_stack_checking_enabled_p
> && SCM_STACK_OVERFLOW_P ((SCM_STACKITEM *) (void*) &proc))
> Another problem seems more difficult:
>
> gcc -DHAVE_CONFIG_H -I. -I../../../guile-core-new/libguile -I.. -I.. -I../../../guile-core-new -I../../../guile-core-new/libguile-ltdl -g -O2 -Werror -Wall -Wmissing-prototypes -Wno-strict-aliasing -MT numbers.lo -MD -MP -MF .deps/numbers.Tpo -c ../../../guile-core-new/libguile/numbers.c -fPIC -DPIC -o .libs/numbers.lo
> In file included from ../../../guile-core-new/libguile/numbers.c:4084:
> ../../../guile-core-new/libguile/num2integral.i.c: In function `scm_num2long_long':
> ../../../guile-core-new/libguile/num2integral.i.c:65: warning: comparison is always false due to limited range of data type
> In file included from ../../../guile-core-new/libguile/numbers.c:4092:
> ../../../guile-core-new/libguile/num2integral.i.c: In function `scm_num2ulong_long':
> ../../../guile-core-new/libguile/num2integral.i.c:65: warning: comparison is always false due to limited range of data type
>
> I think this is a stupid warning message. In any case, you'd want to
> be able to shut it off. I can't find any way to do that. Maybe we
> should talk to the gcc people about this?
Well, your test is: (unsigned long)(some-value) > (unsigned long)~0
and it cannot ever be true. That being the case, delete the code.
Do you really mean: (unsigned long)(some-value) > ((unsigned long)~0)>>1
??
> I've tried to enclose the code causing the warning with a surrounding
> conditional which tests the sizes of the data types, but the compiler
> outputs the above warning even though the code isn't going to be
> compiled.
"isn't going to be compiled" or "would never get executed"?
``#if 0'' should effectively silence it. The preprocessor
knows nothing of this stuff. Clearly, this code gets analyized
before the dead code removal comes along. Maybe put the code under:
#if SIZEOF_SCM_T_BITS > SIZEOF_LONG
Can I get scm_c_eval_string_from_file_line() added, please?
All other solutions have proven intractable.
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-05-19 16:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-19 10:09 Compiling 1.7.0 with gcc-3.3 Mikael Djurfeldt
2003-05-19 14:26 ` Rob Browning
2003-05-19 17:05 ` Bruce Korb
2003-05-22 10:26 ` Mikael Djurfeldt
2003-05-19 16:20 ` Bruce Korb [this message]
2003-05-22 9:37 ` Mikael Djurfeldt
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3EC9045D.E8712F62@veritas.com \
--to=bkorb@veritas.com \
--cc=guile-devel@gnu.org \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).