[ofw] complib\cl_log.h unused function removed compiler warning
Smith, Stan
stan.smith at intel.com
Sun Oct 24 12:17:52 PDT 2010
Tzachi Dar wrote:
> It seems to me that there is also a 5'th option:
> Only have _build_str header in the h file, and define it once in some
> c file.
>
> I guess that this is also very close to the solution of defining the
> function as inline.
That was my original thinking; make it 'inline'.
Further investigation shows comp_lib.h is included in 20 other files so removing cl_log.h from comp_lib.h has ramifications.
>
> Thanks
> Tzachi
>
>> -----Original Message-----
>> From: Smith, Stan [mailto:stan.smith at intel.com]
>> Sent: Saturday, October 23, 2010 1:34 AM
>> To: Fab Tillier; Tzachi Dar
>> Cc: 'ofw at lists.openfabrics.org'
>> Subject: RE: complib\cl_log.h unused function removed compiler
>> warning
>>
>> Fab Tillier wrote:
>>> How about:
>>> 4) don't use comp_lib.h, pick just the stuff you need and include
>>> it.
>>
>> comp_lib.h was not my choice, and indeed it a kitchen sink design
>> approach.
>>
>> Perhaps we should just delete comp_lib.h ?
>>
>>>
>>> -Fab
>>>
>>> Smith, Stan wrote on Fri, 22 Oct 2010 at 15:39:12
>>>
>>>>
>>>> Hello Tzachi,
>>>> If a program includes <complib\comp_lib.h>, which includes
>>>> cl_log.h, and does not reference the CL_PRINT_TO_EVENT_LOG() macro,
>>>> the static defined function in cl_log.h __build_str() is not
>>>> referenced, hence the Windows compiler issues a warning and removes
>>>> the __build_str() function. Warning message is cumbersome and in
>>>> some cases fail the compilation if warnings are treated as errors.
>>>>
>>>> There are a couple of ways to solve this problem, I'm seeking
>>>> advise on the preferred solution:
>>>>
>>>> 1) tag __build_str() as 'inline'
>>>>
>>>> 2) remove include of cl_log.h from comp_lib.h, and use cl_log.h
>>>> with purpose.
>>>>
>>>> 3) Use a #pragma to squelch the compiler warning.
>>>>
>>>> your thoughts?
>>>>
>>>> thanks,
>>>>
>>>> stan.
>>>> _______________________________________________
>>>> ofw mailing list
>>>> ofw at lists.openfabrics.org
>>>> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw
More information about the ofw
mailing list