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

latest 1.2.0 release fails to build with "format not a string literal" #1739

Closed
david-geiger opened this issue Apr 8, 2023 · 4 comments · Fixed by #1746
Closed

latest 1.2.0 release fails to build with "format not a string literal" #1739

david-geiger opened this issue Apr 8, 2023 · 4 comments · Fixed by #1746

Comments

@david-geiger
Copy link

Hi,

I tried on Mageia Linux Cauldron to build latest 1.2.0 release but it fails to build with an error "format not a string literal":

/home/david/mgarepo/hydrogen/BUILD/hydrogen-1.2.0/src/core/Logger.cpp:58:32: error: format not a string literal and no format arguments [-Werror=format-security]
58 | fprintf( stderr,
| ~~~~~~~^~~~~~~~~
59 | QString( "Error: can't open log file [%1] for writing...\n" )
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 | .arg( logger->m_sLogFilePath ).toLocal8Bit().data() );
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
gmake[2]: *** [src/core/CMakeFiles/hydrogen-core-1.2.0.dir/build.make:737: src/core/CMakeFiles/hydrogen-core-1.2.0.dir/Logger.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....

Attached full build log
log.hydrogen.txt

@theGreatWhiteShark
Copy link
Contributor

Hey @david-geiger ,

I can reproduce it. Compilation fails due to the compiler flag -Werror=format-security.

I'll review the compiler flags we use and some more warnings and more strict behavior is most probably a good thing to have. But for now I would suggest you compile without the flag till the next release.

P.S. In your log there are some patches applied to the source code which look outdated and make me wonder why they were necessary in the first place. Do you have any insights into this matter?

@david-geiger
Copy link
Author

Ok so I disable the werror=format-security flag during build adding "Wno-error=format-security" and waiting for a fix in next release.

For the patches one is for fix a python3 shebangs:
https://svnweb.mageia.org/packages/cauldron/hydrogen/current/SOURCES/0001-porting-stats.py-to-Python3.patch?revision=1606281&view=markup

and the other for the desktop file but I see that I can drop it now (it is not really necessary):
https://svnweb.mageia.org/packages/cauldron/hydrogen/current/SOURCES/hydrogen-1.0.0-mga-hydrogen.desktop.patch?revision=1606281&view=markup

@theGreatWhiteShark
Copy link
Contributor

For the patches one is for fix a python3 shebangs:
https://svnweb.mageia.org/packages/cauldron/hydrogen/current/SOURCES/0001-porting-stats.py-to-Python3.patch?revision=1606281&view=markup

I'll apply those changes in our codebase too.

theGreatWhiteShark added a commit to theGreatWhiteShark/hydrogen that referenced this issue Apr 13, 2023
theGreatWhiteShark added a commit to theGreatWhiteShark/hydrogen that referenced this issue Apr 13, 2023
@theGreatWhiteShark
Copy link
Contributor

Could you check whether your toolchain is able to build the source code in #1746?

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Apr 17, 2023
Apply patch to fix format string issue: hydrogen-music/hydrogen#1739

git-svn-id: file:///srv/repos/svn-community/svn@1446677 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Apr 17, 2023
Apply patch to fix format string issue: hydrogen-music/hydrogen#1739

git-svn-id: file:///srv/repos/svn-community/svn@1446677 9fca08f4-af9d-4005-b8df-a31f2cc04f65
theGreatWhiteShark added a commit that referenced this issue Apr 21, 2023
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 a pull request may close this issue.

2 participants