[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openswan-dev
Subject:    Re: [Openswan dev] [PATCH] fix scandir incompatible pointer type
From:       "D. Hugh Redelmeier" <hugh () mimosa ! com>
Date:       2009-06-24 6:39:46
Message-ID: alpine.LRH.2.00.0906240232470.6532 () redclaw ! mimosa ! com
[Download RAW message or body]

| From: Gilles Espinasse <g.esp@free.fr>
| To: dev@openswan.org
| Subject: [Openswan dev] [PATCH] fix scandir incompatible pointer type warning
| 
| google say cast is the way to go for scandir
| http://gcc.gnu.org/ml/java-patches/2003-q1/msg00113.html

That authority is wrong.

For one thing, void * is a universal pointer to an object type and the
required parameter is a pointer to a function type.  So it is invalid
C.

Furthermore, this technique disguises the typing rather than getting it right.

If you look at the code, there is already a macro to get the type
right: SCANDIR_HAS_CONST

So the correct fix is to make sure that the makefile sets the macro
appropriately.

Perhaps it would work if it were just "wired on".  I don't actually
know if any systems that Opensswan supports actually leave out the
const.

So: I'd revert these changes and get SCANDIR_HAS_CONST right.

Note: I've not tested what I've suggested.
_______________________________________________
Dev mailing list
Dev@openswan.org
http://lists.openswan.org/mailman/listinfo/dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic