[ofw] complib\cl_log.h unused function removed compiler warning

Fab Tillier ftillier at microsoft.com
Fri Oct 22 15:55:23 PDT 2010


How about:
4) don't use comp_lib.h, pick just the stuff you need and include it.

-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