[CDRIVER-766] Build warnings for undefined MONGOC_TRACE in #if conditional Created: 30/Jul/15  Updated: 03/May/17  Resolved: 30/Jul/15

Status: Closed
Project: C Driver
Component/s: libmongoc
Affects Version/s: 1.2.0
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GCC 4.9.2


Issue Links:
Related
related to CDRIVER-768 Build warning for possibly uninitiali... Closed

 Description   

Noticed the following warnings when compiling 1.2.0-dev with -Werror. Should these be changed to #ifdef MONGOC_TRACE, or perhaps just wrapped in a defined check (if you actual mean to check for a non-zero value here)?

src/mongoc/mongoc-log.c: In function 'mongoc_log':
src/mongoc/mongoc-log.c:84:5: warning: "MONGOC_TRACE" is not defined [-Wundef]
 #if MONGOC_TRACE
     ^
src/mongoc/mongoc-log.c: In function 'mongoc_log':
src/mongoc/mongoc-log.c:84:5: warning: "MONGOC_TRACE" is not defined [-Wundef]
 #if MONGOC_TRACE
     ^
tests/test-mongoc-log.c: In function ‘should_run_trace_tests’:
tests/test-mongoc-log.c:93:5: warning: "MONGOC_TRACE" is not defined [-Wundef]
 #if MONGOC_TRACE
     ^
tests/TestSuite.c: In function ‘TestSuite_RunTest’:
tests/TestSuite.c:390:5: warning: "MONGOC_TRACE" is not defined [-Wundef]
 #if MONGOC_TRACE
     ^



 Comments   
Comment by Githook User [ 30/Jul/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-766: Build warnings for undefined MONGOC_TRACE
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/5ac5202a1b8fe2abf0d52685f358dd06bd3e0648

Comment by Hannes Magnusson [ 30/Jul/15 ]

#fail.

That should have been ifdef like I did in all other places!

Generated at Wed Feb 07 21:10:34 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.