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

eprintf: Argument fmt should be constant #717

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

concatime
Copy link
Contributor

@concatime concatime commented Mar 3, 2021

This is required, otherwise, you would get, in C++ code, lot of:

warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings]
  DEBUG_PRINT("Waiting for activation ...\n");
              ^

More information here.

printf’s fmt argument is constant too.

Thank you.

@concatime concatime force-pushed the eprintf-const-fmt branch from ba734f1 to 4e1ebda Compare March 3, 2021 19:28
@whoenig whoenig merged commit f04027f into bitcraze:master Mar 3, 2021
@whoenig
Copy link
Contributor

whoenig commented Mar 3, 2021

Thanks! Would be interesting to learn more about your overall clang use-case/story at some point. It certainly improves code quality, but perhaps there is another motivation as well?

@concatime
Copy link
Contributor Author

Thanks! Would be interesting to learn more about your overall clang use-case/story at some point. It certainly improves code quality, but perhaps there is another motivation as well?

My main goal was to add CMake as a build system. I have a profound hate for GNU/BSD Makefiles (I’m fine with POSIX Makefile). It feels like a stockpile of hacks/glue code the whole time. Then, I wanted to add both GCC and Clang as backends to CMake. Finally, I wanted to to use C++/libstdc++ in a crazyflie project for university. I am 100% open to share my build system.

@concatime concatime deleted the eprintf-const-fmt branch March 4, 2021 16:56
@whoenig
Copy link
Contributor

whoenig commented Mar 4, 2021

Sounds awesome - please keep us in the loop with cmake. The added advantage would also be that it is much more portable across platforms (if done right). We certainly have talked before about using CMake rather than a Makefile, but never got around actually working on it.

@jonasdn jonasdn added this to the next-release milestone Mar 17, 2021
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

Successfully merging this pull request may close these issues.

3 participants