[squid-dev] [PATCH] Broken trunk rev14778

Amos Jeffries squid3 at treenet.co.nz
Mon Aug 8 20:50:12 UTC 2016


On 9/08/2016 8:08 a.m., Alex Rousskov wrote:
> On 08/08/2016 01:19 PM, Amos Jeffries wrote:
>> On 9/08/2016 6:01 a.m., Alex Rousskov wrote:
>>> On 08/08/2016 04:43 AM, Amos Jeffries wrote:
>>>
>>>>   r14778: Move static member Last into change() method to avoid initialization order
>>>>   errors when a caller uses a global InstanceId object before the library
>>>>   instantiating its template is initialized.
> 
>>> Have you seen these Last errors?
> 
> 
>> I don't think the pre-initialization of simple types is the issue here.
>> Or maybe Last being an int and thus using that pre-initialization
>> instead of having a contructor symbol is the root of the compilers
>> confusion.
> 
>> It has been occuring on the d,debian-clang farm node for the last few
>> weeks. Relevant part of the log output below.
> 
>> ../../../../src/base/InstanceId.h:28:27: error: instantiation of
>> variable 'InstanceId<SBuf>::Last' required here, but no definition is
>> available [-Werror,-Wundefined-var-template]
>>     InstanceId(): value(++Last ? Last : ++Last) {}
> 
> 
>> The suggested declaration turns out not to e very portable, so I went
>> with moving the global symbol into a method.
> 
> My interpretation of what you are saying is: "I have not seen any
> initialization order errors that r14778 commit message talks about. I
> have seen compiler errors. The true reasons behind those compiler errors
> are not well understood, but moving Last into a method avoids errors in
> my tests".
> 
> Is that interpretation accurate?
> 

Close enough yes.

Amos



More information about the squid-dev mailing list