[CRIU] [PATCH 0/2] make: Add compile time testing for system headers

Cyrill Gorcunov gorcunov at openvz.org
Tue May 7 16:43:35 EDT 2013


On Tue, May 07, 2013 at 01:37:43PM -0700, Kir Kolyshkin wrote:
> On 05/07/2013 01:08 PM, Cyrill Gorcunov wrote:
> >On Tue, May 07, 2013 at 11:26:47PM +0400, Pavel Emelyanov wrote:
> >>On 05/07/2013 11:14 PM, Cyrill Gorcunov wrote:
> >>>On Tue, May 07, 2013 at 11:08:37PM +0400, Pavel Emelyanov wrote:
> >>>>2 things bother me.
> >>>>
> >>>>1. tcp piggie compilation fail may be not due to structs duplication
> >>>>2. code duplication between sk-tcp.c and utilities.mak
> >>>At moment we address only name clashes (struct and enums), thus if we
> >>>need more precise (per-member check or say size of structure check) this
> >>>facility won't be enough for sure. But I must admit I don't fully understand
> >>>(1), could you please elaborate?
> >>I mean "name clash => compilation fail", but the reverse statement is not true,
> >>while we rely on it.
> >But the test is exactly for name redefinition detection, nothing more ;)
> >If compilation fail we will have to investigate what's gone wrong anyway.
> >
> 
> May I suggest a proper test for this? I just took a look at how
> autoconf does it.

Sure. Feel free to experiment, lets choose the approach which is better
for us.

> What they have is AC_CHECK_MEMBER macro which checks for a specific member
> in a structure. The code generated (except for #includes) looks like this:
...

> The idea is the only reason such code should fail to compile is when
> struct is undefined,
> or header file is not found (for which we can add another test if needed).

I see. Looks cool for me. Mind to grab the patches and play with it?
Then if things go well we could merge it into single new patch series.
(I likely ti be able to continue working with make tomorrow only, stuck
 with another task at moment).


More information about the CRIU mailing list