adeharo9 / cpp-dotenv

Loads environment variables from .env files for C++ projects.
BSD 3-Clause "New" or "Revised" License
87 stars 19 forks source link

Unused parameter 'unbind(std::string& s)' line 397 #13

Closed GeorgeDuckman closed 4 years ago

GeorgeDuckman commented 4 years ago

The use of the library on a project using the compilation option "-Wunused-parameter" shows that the function "inline void unbind(std::string& s)" line 397 does not use its parameter.

I use the library with FetchContent.

A solution would be to set the library's compilation options in its CMakeLists.txt with target_compile_options or removing the parameter name in the code like this :

        inline void unbind(std::string& /*s*/)
        {
            binded = nullptr;
            bond = false;
        }

Do you have any other solutions?

adeharo9 commented 4 years ago

Absolutely right. I guess at some point during the initial development I simply removed its usage from the unbind function but failed to delete the parameter and update the rest of the code.

I'll simply remove it and add the change for the next update on master.

adeharo9 commented 4 years ago

Solved and merged to dev.

Merging to master is still pending, but will happen in the upcoming days with several more changes and updates than I'm introducing.

Closing the issue for now.