unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* Intel icc finds too many errors in guile 1.8.8 to compile
@ 2009-08-28  9:22 I.Gutheil
  2009-10-02 21:21 ` Neil Jerram
  0 siblings, 1 reply; 6+ messages in thread
From: I.Gutheil @ 2009-08-28  9:22 UTC (permalink / raw)
  To: bug-guile

Hello all,
did anyone try to compile the guile codes with another compiler but the gcc?
When I tried to use the icc, I got
gen-scmconfig.c(257): error #279: controlling expression is constant
     if (SCM_I_GSC_C_INLINE)
         ^

gen-scmconfig.c(321): error #279: controlling expression is constant
     if (SCM_I_GSC_T_INT64)
         ^

gen-scmconfig.c(333): error #279: controlling expression is constant
     if (SCM_I_GSC_T_UINT64)
So I had to change the
     if (SCM_I_GSC_T_UINT64)
to
#ifdef (SCM_I_GSC_T_UINT64)
#else
#endif
because these directives had nun-numerical values.

The next problem occured with


debug.c(62): error #188: enumerated type mixed with another type
     scm_dynwind_begin (0);

This could be "corrected" by declaring
in dynwind.h
SCM_API void scm_dynwind_begin (int) instead of the derived datatype
which could only be 1
and in dynwind.c

void
scm_dynwind_begin (int flags)
...

I get a lot of remarks that

  operands are evaluated in unspecified order

and
remark #193: zero used for undefined preprocessing identifier
"HAVE_SYS_STDTYPES_H"
  (for example)

but finally I came to a compiler error which I could not correct:

eval.c(4114): error #589: transfer of control bypasses initialization of:
             variable "orig_sym" (declared at line 4038)
        goto handle_a_macro;
        ^

And just for eval.c I get about 700 remarks like
eval.c(6021): remark #981: operands are evaluated in unspecified order
       return SCM_I_XEVAL (x, env);
              ^
(which is the last one)

So I think I have to switch to gcc and just accept what gcc is making of
that code??

Any better idea?

P.S. I do not use the guile package myself but I want to install it for
someone who wants to use meep on a Nehalem Cluster here in Juelich.

Sincerely

Inge Gutheil

--

Inge Gutheil
Juelich Supercomputing Centre
Institute for Advanced Simulation
Forschungszentrum Juelich GmbH
52425 Juelich, Germany

Phone:  +49-2461-61-3135
Fax:    +49-2461-61-6656
E-mail: i.gutheil@fz-juelich.de



------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
Prof. Dr. Sebastian M. Schmidt
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------




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

* Re: Intel icc finds too many errors in guile 1.8.8 to compile
  2009-08-28  9:22 Intel icc finds too many errors in guile 1.8.8 to compile I.Gutheil
@ 2009-10-02 21:21 ` Neil Jerram
  2009-10-03  9:43   ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Jerram @ 2009-10-02 21:21 UTC (permalink / raw)
  To: I.Gutheil; +Cc: bug-guile

"I.Gutheil" <i.gutheil@fz-juelich.de> writes:

> Hello all,
> did anyone try to compile the guile codes with another compiler but the gcc?
> When I tried to use the icc, I got
> gen-scmconfig.c(257): error #279: controlling expression is constant
>     if (SCM_I_GSC_C_INLINE)
>         ^
>
> gen-scmconfig.c(321): error #279: controlling expression is constant
>     if (SCM_I_GSC_T_INT64)
>         ^
>
> gen-scmconfig.c(333): error #279: controlling expression is constant
>     if (SCM_I_GSC_T_UINT64)

Presumably that only happens with an option like -Werror?

If so, the solution is not to use that option.

> debug.c(62): error #188: enumerated type mixed with another type
>     scm_dynwind_begin (0);
>
> This could be "corrected" by declaring
> in dynwind.h
> SCM_API void scm_dynwind_begin (int) instead of the derived datatype
> which could only be 1
> and in dynwind.c
>
> void
> scm_dynwind_begin (int flags)
> ...

Agreed; using enums here is just asking for trouble.  I've changed it to
#defines.

> I get a lot of remarks that
>
>  operands are evaluated in unspecified order
>
> and
> remark #193: zero used for undefined preprocessing identifier
> "HAVE_SYS_STDTYPES_H"
>  (for example)

In general I would say that those remarks don't matter.  Are there any
that you think indicate actual problems?

> but finally I came to a compiler error which I could not correct:
>
> eval.c(4114): error #589: transfer of control bypasses initialization of:
>             variable "orig_sym" (declared at line 4038)
>        goto handle_a_macro;

Do you still see this?  Looking at the code now, there are no labels
between where orig_sym is declared and initialized, and where it's used;
so I can't see a problem.

> And just for eval.c I get about 700 remarks like
> eval.c(6021): remark #981: operands are evaluated in unspecified order
>       return SCM_I_XEVAL (x, env);
>              ^
> (which is the last one)

As above, I doubt that any of these are real problems.  If you want to
clean up your icc build, can you disable those remarks?

Regards,
        Neil




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

* Re: Intel icc finds too many errors in guile 1.8.8 to compile
  2009-10-02 21:21 ` Neil Jerram
@ 2009-10-03  9:43   ` Ludovic Courtès
       [not found]     ` <8763avzfh9.fsf@ossau.uklinux.net>
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2009-10-03  9:43 UTC (permalink / raw)
  To: bug-guile

Hi,

Neil Jerram <neil@ossau.uklinux.net> writes:

> "I.Gutheil" <i.gutheil@fz-juelich.de> writes:

[...]

>> debug.c(62): error #188: enumerated type mixed with another type
>>     scm_dynwind_begin (0);
>>
>> This could be "corrected" by declaring
>> in dynwind.h
>> SCM_API void scm_dynwind_begin (int) instead of the derived datatype
>> which could only be 1
>> and in dynwind.c
>>
>> void
>> scm_dynwind_begin (int flags)
>> ...
>
> Agreed; using enums here is just asking for trouble.  I've changed it to
> #defines.

Per C99 Section 6.4.4.3, “an identifier declared as an enumeration
constant has type int”, so ICC is pedantic.

I think having disjoint ‘scm_t_wind_flags’ and ‘scm_t_dynwind_flags’
types was helpful to indicate which flags are valid for which function.
Thus, I’d rather have fixed it by adding a named enumeration constant
for 0 in each of these types.

At any rate, I think we should probably keep “typedef int
scm_t_wind_flags;” and “typedef int scm_t_dynwind_flags”.

What do you think?

Thanks,
Ludo’.





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

* Re: Intel icc finds too many errors in guile 1.8.8 to compile
       [not found]       ` <87r5tjbb0h.fsf@gnu.org>
@ 2009-10-06 21:06         ` Neil Jerram
  2009-10-06 22:50           ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Neil Jerram @ 2009-10-06 21:06 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guile

ludo@gnu.org (Ludovic Courtès) writes:

> I agree.  Adding a named constant for 0 is one way to help the compiler
> spot such mistakes.

[...]

> So these could become, say:
>
>   enum scm_dynwind_flags
>   {
>     SCM_F_DYNWIND_NOT_REWINDABLE = 0,
>     SCM_F_DYNWIND_NOT_REWINDABLE
>   };
>
>   typedef enum scm_dynwind_flags scm_t_dynwind_flags;
>
>   enum scm_wind_flags
>   {
>     SCM_F_WIND_NON_LOCAL_EXIT = 0,
>     SCM_F_WIND_EXPLICITLY
>   };
>
>   typedef enum scm_wind_flags scm_t_wind_flags;

But wouldn't this approach break as soon as we added another flag, in
the way that I described in my previous email?

If the answer to that is yes, I think the reality is that bit flag
combinations can't be made type-safe in C, and therefore we should stick
with #defines.

Regards,
        Neil




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

* Re: Intel icc finds too many errors in guile 1.8.8 to compile
  2009-10-06 21:06         ` Neil Jerram
@ 2009-10-06 22:50           ` Ludovic Courtès
  2009-10-07 21:09             ` Neil Jerram
  0 siblings, 1 reply; 6+ messages in thread
From: Ludovic Courtès @ 2009-10-06 22:50 UTC (permalink / raw)
  To: bug-guile

Hi,

Neil Jerram <neil@ossau.uklinux.net> writes:

> ludo@gnu.org (Ludovic Courtès) writes:

[...]

>> So these could become, say:
>>
>>   enum scm_dynwind_flags
>>   {
>>     SCM_F_DYNWIND_NOT_REWINDABLE = 0,
>>     SCM_F_DYNWIND_NOT_REWINDABLE
>>   };
>>
>>   typedef enum scm_dynwind_flags scm_t_dynwind_flags;
>>
>>   enum scm_wind_flags
>>   {
>>     SCM_F_WIND_NON_LOCAL_EXIT = 0,
>>     SCM_F_WIND_EXPLICITLY
>>   };
>>
>>   typedef enum scm_wind_flags scm_t_wind_flags;
>
> But wouldn't this approach break as soon as we added another flag, in
> the way that I described in my previous email?

Yes it would.

But the underlying question is: is the set of flags likely to change?
If the answer is “no” (which I think it is), it’s probably safe to go
for an ‘enum’, as these flags cannot be combined anyway.

Thanks,
Ludo’.





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

* Re: Intel icc finds too many errors in guile 1.8.8 to compile
  2009-10-06 22:50           ` Ludovic Courtès
@ 2009-10-07 21:09             ` Neil Jerram
  0 siblings, 0 replies; 6+ messages in thread
From: Neil Jerram @ 2009-10-07 21:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: bug-guile

ludo@gnu.org (Ludovic Courtès) writes:

>> But wouldn't this approach break as soon as we added another flag, in
>> the way that I described in my previous email?
>
> Yes it would.
>
> But the underlying question is: is the set of flags likely to change?
> If the answer is “no” (which I think it is), it’s probably safe to go
> for an ‘enum’, as these flags cannot be combined anyway.

Hmm.  I think that's quite inelegant, to use a representation of flags
that would break if there was ever more than one flag (!).

I was going to conclude "So I'll revert my change and just add the zero
value instead", but then I wondered if we have any clear reason to
believe that that would help ICC.  There are several occurrences in
libguile of scm_dynwind_begin (0), and ICC could still complain, and
only be happy with scm_dynwind_begin (SCM_F_DYNWIND_NO_FLAGS).

So instead I'll just revert my change, and wait until we get more data
that a possible solution actually works for ICC.

Inge, if you're following this, can you try changing the enum
definitions to

  typedef enum {
    SCM_F_DYNWIND_NO_FLAGS = 0,
    SCM_F_DYNWIND_REWINDABLE = (1 << 0)
  } scm_t_dynwind_flags;
  
  typedef enum {
    SCM_F_WIND_NO_FLAGS = 0,
    SCM_F_WIND_EXPLICITLY = (1 << 0)
  } scm_t_wind_flags;

and report if that removes the related ICC errors?

Thanks,
        Neil




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

end of thread, other threads:[~2009-10-07 21:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-28  9:22 Intel icc finds too many errors in guile 1.8.8 to compile I.Gutheil
2009-10-02 21:21 ` Neil Jerram
2009-10-03  9:43   ` Ludovic Courtès
     [not found]     ` <8763avzfh9.fsf@ossau.uklinux.net>
     [not found]       ` <87r5tjbb0h.fsf@gnu.org>
2009-10-06 21:06         ` Neil Jerram
2009-10-06 22:50           ` Ludovic Courtès
2009-10-07 21:09             ` Neil Jerram

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