Quite a few Linux distributions (Fedora for example) are enabling the
Code: Select all
-Wformat-security
Code: Select all
diff -ur ../iv-18.orig/src/lib/IV-2_6/matcheditor.cpp ./src/lib/IV-2_6/matcheditor.cpp
--- ../iv-18.orig/src/lib/IV-2_6/matcheditor.cpp 2014-01-08 19:10:44.895487120 +1100
+++ ./src/lib/IV-2_6/matcheditor.cpp 2014-01-08 19:11:05.949315579 +1100
@@ -82,7 +82,7 @@
strncpy(buf, text->Text(), length);
while (length > 0) {
buf[length] = '\0';
- if (sscanf(buf, pattern) == EOF) {
+ if (sscanf(buf, "%s", pattern) == EOF) {
break;
}
--length;
There are also quite a few errors related to -Wnarrowing but I haven't a patch yet.
System details:
Code: Select all
[asinha@CS-1E114-2 iv]$ hg summary
parent: 23:91e22c4a0a0c tip
mingw+python+interviews works.
branch: default
commit: 2 modified, 591 unknown
update: (current)
[asinha@CS-1E114-2 iv]$ gcc --version
gcc (GCC) 6.1.1 20160621 (Red Hat 6.1.1-3)
asinha@CS-1E114-2 iv]$ cat /etc/os-release
NAME=Fedora
VERSION="24 (Server Edition)"
...