Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor utils api to clean up warnings #166

Open
K20shores opened this issue Jun 25, 2024 · 0 comments
Open

Refactor utils api to clean up warnings #166

K20shores opened this issue Jun 25, 2024 · 0 comments

Comments

@K20shores
Copy link
Collaborator

When building musica, several warnings are generated

[ 89%] Building CXX object src/CMakeFiles/musica.dir/util.cpp.o
In file included from /Users/kshores/Documents/musica/src/util.cpp:3:
/Users/kshores/Documents/musica/include/musica/util.hpp:45:12: warning: 'CreateString' has C-linkage specified, but returns user-defined type 'String' which is incompatible with C [-Wreturn-type-c-linkage]
    String CreateString(const char* value);
           ^
/Users/kshores/Documents/musica/include/musica/util.hpp:53:11: warning: 'NoError' has C-linkage specified, but returns user-defined type 'Error' which is incompatible with C [-Wreturn-type-c-linkage]
    Error NoError();
          ^
/Users/kshores/Documents/musica/include/musica/util.hpp:60:11: warning: 'ToError' has C-linkage specified, but returns user-defined type 'Error' which is incompatible with C [-Wreturn-type-c-linkage]
    Error ToError(const char* category, int code, const char* message);
          ^
3 warnings generated.
[ 90%] Building CXX object src/CMakeFiles/musica.dir/component_versions.cpp.o
[ 90%] Building CXX object src/CMakeFiles/musica.dir/__/version.cpp.o
[ 91%] Building CXX object src/CMakeFiles/musica.dir/micm/micm.cpp.o
In file included from /Users/kshores/Documents/musica/src/micm/micm.cpp:7:
In file included from /Users/kshores/Documents/musica/include/musica/micm.hpp:8:
/Users/kshores/Documents/musica/include/musica/util.hpp:45:12: warning: 'CreateString' has C-linkage specified, but returns user-defined type 'String' which is incompatible with C [-Wreturn-type-c-linkage]
    String CreateString(const char* value);
           ^
/Users/kshores/Documents/musica/include/musica/util.hpp:53:11: warning: 'NoError' has C-linkage specified, but returns user-defined type 'Error' which is incompatible with C [-Wreturn-type-c-linkage]
    Error NoError();
          ^
/Users/kshores/Documents/musica/include/musica/util.hpp:60:11: warning: 'ToError' has C-linkage specified, but returns user-defined type 'Error' which is incompatible with C [-Wreturn-type-c-linkage]
    Error ToError(const char* category, int code, const char* message);
          ^
In file included from /Users/kshores/Documents/musica/src/micm/micm.cpp:7:
/Users/kshores/Documents/musica/include/musica/micm.hpp:31:12: warning: 'get_micm_version' has C-linkage specified, but returns user-defined type 'String' which is incompatible with C [-Wreturn-type-c-linkage]
    String get_micm_version(void);
           ^
/Users/kshores/Documents/musica/include/musica/micm.hpp:47:12: warning: 'GetSpeciesPropertyString' has C-linkage specified, but returns user-defined type 'String' which is incompatible with C [-Wreturn-type-c-linkage]
    String GetSpeciesPropertyString(MICM *micm, const char *species_name, const char *property_name, Error *error);
           ^
5 warnings generated.
[ 92%] Building CXX object src/CMakeFiles/musica.dir/tuvx/tuvx.cpp.o
In file included from /Users/kshores/Documents/musica/src/tuvx/tuvx.cpp:6:
In file included from /Users/kshores/Documents/musica/include/musica/tuvx.hpp:8:
/Users/kshores/Documents/musica/include/musica/util.hpp:45:12: warning: 'CreateString' has C-linkage specified, but returns user-defined type 'String' which is incompatible with C [-Wreturn-type-c-linkage]
    String CreateString(const char* value);
           ^
/Users/kshores/Documents/musica/include/musica/util.hpp:53:11: warning: 'NoError' has C-linkage specified, but returns user-defined type 'Error' which is incompatible with C [-Wreturn-type-c-linkage]
    Error NoError();
          ^
/Users/kshores/Documents/musica/include/musica/util.hpp:60:11: warning: 'ToError' has C-linkage specified, but returns user-defined type 'Error' which is incompatible with C [-Wreturn-type-c-linkage]
    Error ToError(const char* category, int code, const char* message);
          ^
3 warnings generated.

Refator the utils api so that these go away

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant