New python PIDL checks cause 2221 new Coverity warnings

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Aug 27 05:38:13 UTC 2015


On Thu, Aug 27, 2015 at 02:44:31PM +1200, Andrew Bartlett wrote:
> Specifically, it is the mapping of an arbitrary value of type:
> 
> /^(uint[0-9]*|hyper|udlong|udlongr
>                                 |NTTIME_hyper|NTTIME|NTTIME_1sec
>                                 |uid_t|gid_t)$/
> or 
> /^(dlong|char|int[0-9]*|time_t)$/
> 
> and working out if it will fit into a Python Int, or if a Python Long
> is required.  
> 
> A python int will fix a value up to LONG_MAX, which as you know is arch
> -dependent. 
> 
> Jelmer expressed a strong preference that we not just use a Python Long
> always, due to the memory overhead, and it creates a subtly different
> type in Python2 anyway (L suffix).  
> 
> Finally, we should try to keep the solution as generic as possible, as
> when we add new base types to PIDL, all these lists need to be updated,
> and the person who is doing so probably won't remember the full
> background.

If you don't want to put ifdefs into generated code, can't we put that
into a handcrafted helper function and call that in the autogenerated
code?

We have arch-dependent #ifdefs in many places, see for example byteorder.h.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list