[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC 02/25] A collection of fixes to Xen common files



>>> On 07.12.11 at 13:43, Tim Deegan <tim@xxxxxxx> wrote:
> At 09:00 +0000 on 07 Dec (1323248401), Jan Beulich wrote:
>> >>> On 06.12.11 at 19:19, <stefano.stabellini@xxxxxxxxxxxxx> wrote:
>> > - call free_xenoprof_pages only ifdef xenoprof;
>> 
>> I can't find where this symbol would get defined, so effectively you're
>> removing the call unconditionally.
>> 
>> > +extern char _srodata[], _erodata[];
>> 
>> While I realize that this isn't currently the case on e.g. the respective
>> .text symbols, if you introduce new once, please add const to the
>> declarations *at least* when the section contents really are read only
>> (in many cases doing so even for writable sections is likely appropriate
>> too).
> 
> Is this just a question of style or is there any practical consequence?
> (not that I object to adding 'const' here; I'm just curious)

Pointers to non-modifiable data should never lack const, to avoid them
accidentally (perhaps through several layers of functions) being passed
to something that does actually write through them. (This is on the
same page as avoiding casts in general when possible, but specifically
such that cast away const-ness.)

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.