[CDRIVER-560] Need to add mongoc-client-pool-private.h in mongoc-client-pool-private.c Created: 06/Mar/15  Updated: 07/Oct/15  Resolved: 05/Apr/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: 1.1.2
Fix Version/s: 1.1.5

Type: Improvement Priority: Trivial - P5
Reporter: Jerome Lebel Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

the function mongoc_client_pool_get_size() is declared in mongoc-client-pool-private.h and its implementation in mongoc-client-pool-private.c.

The issue is mongoc-client-pool-private.c doesn't include mongoc-client-pool-private.h, therefore, the compiler doesn't see the declaration of this function while compiling the implementation of this function. There is a warning on OS X.



 Comments   
Comment by Githook User [ 07/Oct/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: Merge remote-tracking branch 'upstream/master' into 1.2.0-dev

  1. By A. Jesse Jiryu Davis (7) and others
  • upstream/master:
    CDRIVER-606 Call mongoc_init () in test-secondary
    Begin next release's changelog
    Spelling.
    Include header for suppress_one_message() in test-mongoc-uri.c.
    CDRIVER-605 fix function name in collection_find_indexes page.
    Fix version no. in guide to building from release tarball.
    post release bump
    Release 1.1.4
    CDRIVER-580: fsync or j in write concern imply GLE
    Use write concern macros instead of magic numbers
    CDRIVER-560: Include private header in mongoc-client-pool.c.

Conflicts:
src/libbson
src/mongoc/mongoc-client-pool.c
src/mongoc/mongoc-uri.c
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/673d4a7aab3d8b46a676ea97b4cd46c5956f976c

Comment by Githook User [ 07/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: Merge remote-tracking branch 'upstream/master' into 1.2.0-dev

  1. By A. Jesse Jiryu Davis (7) and others
  • upstream/master:
    CDRIVER-606 Call mongoc_init () in test-secondary
    Begin next release's changelog
    Spelling.
    Include header for suppress_one_message() in test-mongoc-uri.c.
    CDRIVER-605 fix function name in collection_find_indexes page.
    Fix version no. in guide to building from release tarball.
    post release bump
    Release 1.1.4
    CDRIVER-580: fsync or j in write concern imply GLE
    Use write concern macros instead of magic numbers
    CDRIVER-560: Include private header in mongoc-client-pool.c.

Conflicts:
src/libbson
src/mongoc/mongoc-client-pool.c
src/mongoc/mongoc-uri.c
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/673d4a7aab3d8b46a676ea97b4cd46c5956f976c

Comment by Githook User [ 07/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #189 from ajdavis/CDRIVER-560-client-pool-private-h

CDRIVER-560: Include private header in mongoc-client-pool.c.
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/e3f7c92ee623d72ccae8024b5694126fc1047042

Comment by Githook User [ 07/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #189 from ajdavis/CDRIVER-560-client-pool-private-h

CDRIVER-560: Include private header in mongoc-client-pool.c.
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/e3f7c92ee623d72ccae8024b5694126fc1047042

Comment by Githook User [ 07/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-560: Include private header in mongoc-client-pool.c.
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/0b7d19020cadb6bf293b3ff4d031ba74901a361f

Comment by Githook User [ 05/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #189 from ajdavis/CDRIVER-560-client-pool-private-h

CDRIVER-560: Include private header in mongoc-client-pool.c.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/e3f7c92ee623d72ccae8024b5694126fc1047042

Comment by Githook User [ 05/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@emptysquare.net'}

Message: Merge pull request #189 from ajdavis/CDRIVER-560-client-pool-private-h

CDRIVER-560: Include private header in mongoc-client-pool.c.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/e3f7c92ee623d72ccae8024b5694126fc1047042

Comment by Githook User [ 05/Apr/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-560: Include private header in mongoc-client-pool.c.
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/0b7d19020cadb6bf293b3ff4d031ba74901a361f

Comment by Jerome Lebel [ 13/Mar/15 ]

And the error is:

/Users/jerome/Sources/MongoHub-Mac/Libraries/MongoObjCDriver/Libraries/mongo-c-driver/src/mongoc/mongoc-client-pool.c:228:1: error: no previous prototype for function 'mongoc_client_pool_get_size' [-Werror,-Wmissing-prototypes]
mongoc_client_pool_get_size (mongoc_client_pool_t *pool)

Comment by Jerome Lebel [ 11/Mar/15 ]

The pull request fixes exactly the issue.

The problem is if the declaration is changed in mongoc-client-pool-private.h or the implementation in mongoc-client-pool.c, there is no way for the compiler to let you know the interface don't match. That's why there is a warning saying : since the function is not static, you need to have a declaration of this function somewhere in the mongoc-client-pool.c

I'm compiling the source myself with Xcode on OS X.

Comment by A. Jesse Jiryu Davis [ 11/Mar/15 ]

https://github.com/mongodb/mongo-c-driver/pull/189

Comment by A. Jesse Jiryu Davis [ 11/Mar/15 ]

Can you tell us how you're building the driver and what warning you see please?

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