[Openswan dev] [Openswan Users] Error when build openswan-2.6.25 and git version on arch

D. Hugh Redelmeier hugh at mimosa.com
Fri May 7 17:17:45 EDT 2010

| From: Paul Wouters <paul at xelerance.com>

| On Wed, 5 May 2010, Olivier Gleizes wrote:
| > Le 04/05/2010 18:19, Olivier Gleizes a écrit :
| >
| >       I have an error when i try to build openswan on Arch (i686)
| >       I have the same error with the AUR, 2.6.25 and git version.
| > 
| > 
| > This patch  https://gsoc.xelerance.com/issues/1108 fix this issue.
| > 
| > I try it and everthing work fine now.
| That's a horrible fix. If you need to typecast that many things, the proper
| fix lies elsewhere. I'll have a look at it but I doubt we will apply that patch.

Bug 1108 error report makes it appear that the compiler does not allow
enum literals from different enumerations to be compared.  And this
appears to be an error, not a warning.

As a kind of lint message, this might be useful.  I don't think that
the C standards allow the compiler to refuse to compile it.

The extra casts appear designed to overcome such an error.  If that is
necessary, then the casts are reasonable.

I tried to get the same error with the enclosed program but failed.
So something is wrong in my understanding.  (Quite likely: the only
code I looked at is the little bit in the patch.)

- something else is upsetting the compiler

- the compiler was given different flags that cause it to be more
  picky (I only used -Wall)

- a different compiler is being used (I'm using gcc (GCC) 4.4.1
  20090725 (Red Hat 4.4.1-2))

- something else that I haven't thought of.

Test program:

enum colour {red, green, blue};
enum size {small, medium, large};

    return red > medium? red : medium;

More information about the Dev mailing list