Skip to content

Prototype of subscribe_callback is incorrect #2367

@snej

Description

@snej

The prototype of subscribe_callback in mosquitopp.h doesn't match the function definition in mosquittopp.cpp -- the one in the header has a parameter bool retained that doesn't appear in the impl.

The result is that client code that calls this function will produce a link error, since it's calling a function with a different mangled name than the one implemented. There will also be a warning or error if compiling with strict prototype checking:

/Users/snej/Couchbase/Tools/couchbase-mobile-tools/vendor/mosquitto/lib/cpp/mosquittopp.cpp:156:19: error: no previous prototype for function 'subscribe_callback' [-Werror,-Wmissing-prototypes]
mosqpp_EXPORT int subscribe_callback(
                  ^

It looks as though the parameter should be removed from the header. The implementation just calls through to mosquitto_subscribe_callback, which has no corresponding retained parameter, so there's no point in passing one to the C++ function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions