On 7 January 2015 at 00:07, Andrew Deryabin  wrote:
> 07.01.2015 08:17, Orcan Ogetbil пишет:
>
>> On 6 January 2015 at 16:14, Andrew Deryabin wrote:
>>>
>>> Great!!
>>>
>>> Now it's time to port MusE to Qt 5 ;)
>>>
>> Wow! Great work guys. I always wanted to write the LV2 plugin, but
>> never had time.
>> Thank you Andrew for taking care of this.
>>
>> Porting Qt? Good memories. :)
>> I read that that will be easier than last time.
>
>
> Well, If nothing serious will happen with my free time, I'll try cope with
> this task till May or April (of this year) :)
>

Awesome! I just had a chance to try the lv2 stuff. It works like a
charm. I cannot thank you enough for this!!!

Note that, though, I got some compilation errors with
-Werror=format-security, such as

song.cpp: In function 'void MusECore::writeStringToFile(FILE*, char*)':
song.cpp:3207:23: error: format not a string literal and no format
arguments [-Werror=format-security]
     printf(writeString);
                       ^
I made a fix/workaround for this. This compilation flag is enabled by
default in various distros (at least in Fedora and Ubuntu) during
package building. Packagers will likely want to have this fix.
I added the flag to the compilation flags CMAKE_CXX_FLAGS, so that we
will see such errors earlier in the game next time. Sorry, I should
have done this earlier.

Apparently I cannot commit to git anymore. It's been a while since
last time. I am attaching the patch. Could someone commit this in for
me?

Also you will most likely need to do a clean rebuild on your checkout
after this.

Cheers,
Orcan
diff --git a/muse2/CMakeLists.txt b/muse2/CMakeLists.txt
index c587790..527fbc3 100644
--- a/muse2/CMakeLists.txt
+++ b/muse2/CMakeLists.txt
@@ -478,7 +478,7 @@ IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
   INCLUDE(CPack)
 ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
 
-set(CMAKE_CXX_FLAGS         "-Wall -Wextra -Winvalid-pch -fno-exceptions -fPIC ${CMAKE_CXX_FLAGS}")
+set(CMAKE_CXX_FLAGS         "-Wall -Werror=format-security -Wextra -Winvalid-pch -fno-exceptions -fPIC ${CMAKE_CXX_FLAGS}")
 set(CMAKE_CXX_FLAGS_RELEASE "-O2 -fomit-frame-pointer -ffast-math -fstrength-reduce -fPIC ${CMAKE_CXX_FLAGS_RELEASE}")
 set(CMAKE_CXX_FLAGS_DEBUG   "-g -O0 -DQT_DEBUG -fPIC ${CMAKE_CXX_FLAGS_DEBUG}")
 
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 6e32dd4..6abe3c6 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,3 +1,6 @@
+07.01.2015:
+         - Fix build failure with -Werror=format-security. Suppress some warnings. (oo)
+         - Added -Werror=format-security to compilation flags. (oo)
 06.01.2015:
          - MusE 2.2 release (rj)
 02.01.2015:
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp
index 4fa4afd..cc39f0d 100644
--- a/muse2/muse/song.cpp
+++ b/muse2/muse/song.cpp
@@ -3204,7 +3204,7 @@ void Song::removeTrack3(Track* /*track*/)//prevent of compiler warning: unused p
 void writeStringToFile(FILE *filePointer, char *writeString)
 {
   if (MusEGlobal::debugMsg)
-    printf(writeString);
+    fputs(writeString, stdout);
   fputs(writeString, filePointer);
 }
 
@@ -3320,7 +3320,7 @@ void Song::executeScript(const char* scriptfile, PartList* parts, int quant, boo
             writeStringToFile(fp,tempStr);
 
             if (MusEGlobal::debugMsg)
-              printf("Events in part %d\n", part->events().size());
+              printf("Events in part %lu\n", part->events().size());
 
             EventList elist = part->events();
             for (ciEvent e = elist.begin(); e != elist.end(); e++)
@@ -3377,7 +3377,7 @@ void Song::executeScript(const char* scriptfile, PartList* parts, int quant, boo
               {
                 line = stream.readLine(); // line of text excluding '\n'
                 if (MusEGlobal::debugMsg) {
-                  printf(line.toLatin1().data());
+                  fputs(line.toLatin1().data(), stdout);
                   printf("\n");
                 }
 
------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Lmuse-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lmuse-developer

Reply via email to