[Openswan dev] libosw (fwd)

D. Hugh Redelmeier hugh at mimosa.com
Tue Sep 13 11:53:51 EDT 2011


With permission, I'm forwarding a message from MCR

---------- Forwarded message ----------
X-Spam-Level: 
From: Michael Richardson <mcr at sandelman.ca>
Date: Mon, 12 Sep 2011 21:47:10 -0400
Subject: libosw


I'm using libopenswan (initsubnet, etc.) in another project.
We just discovered that gcc-4.5 is even more pedantic.

initsubnet.c: In function 'initsubnet':
initsubnet.c:38:2: error: new qualifiers in middle of multi-level non-const cast are unsafe

referring to:

	n = addrbytesptr(&dst->addr, (const unsigned char **)&p);

the net suggests that maybe it should be:
	n = addrbytesptr(&dst->addr, (const unsigned char *const *)&p);

but, actually that's not right, the function is going to modify the
thing pointed to, but not the pointer itself. 

google found one hit for this error on the openswan list a year ago, but
nobody appears to have solved this, unless I missed something.

Do you understand this?  I think that I need to write "non-const", but I
didn't think I could do that.

-- 
]       He who is tired of Weird Al is tired of life!           |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] mcr at sandelman.ottawa.on.ca http://www.sandelman.ottawa.on.ca/ |device driver[
   Kyoto Plus: watch the video <http://www.youtube.com/watch?v=kzx1ycLXQSE>
	               then sign the petition. 


More information about the Dev mailing list