Discussion:
[Linphone-developers] Compile failure
Robert Dyck
2018-06-17 21:22:29 UTC
Permalink
Dear developers, FYI
Source is from git as June 17.

[ 29%] Building C object src/CMakeFiles/mediastreamer_voip.dir/audiofilters/
tonedetector.c.o
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
audiofilters/tonedetector.c:* In function ‘*detector_process*’:
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
audiofilters/tonedetector.c:176:8:* *error: *‘*strncpy*’ specified bound 8 equals
destination size [*-Werror=stringop-trunca*
]
*strncpy(event.tone_name,tone_def->tone_name,sizeof(event.tone_name))*;
*^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~*
Bernd Kuhls
2018-07-29 19:31:34 UTC
Permalink
Post by Robert Dyck
Dear developers, FYI
Source is from git as June 17.
[ 29%] Building C object src/CMakeFiles/mediastreamer_voip.dir/
audiofilters/
Post by Robert Dyck
tonedetector.c.o
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
audiofilters/tonedetector.c:176:8:* *error: *‘*strncpy*’ specified
bound 8 equals
Post by Robert Dyck
destination size [*-Werror=stringop-trunca*
]
*strncpy(event.tone_name,tone_def->tone_name,sizeof(event.tone_name))*;
Hi,

same here while building linphone-desktop for linux with git master HEAD
after updating Debian testing to gcc8.

Regards, Bernd
Robert Dyck
2018-07-29 20:01:01 UTC
Permalink
I believe it is due to a change in the C standard library. The warning means
that the new version of the function may truncate the string. This triggers a
warning. The linphone build system treats warnings as errors. I tried setting
"enable_strict" to no but it didn't help. cmake said it was an unused option.

I have my doubts that the developers monitor this list.
Rob D
Post by Robert Dyck
Post by Robert Dyck
Dear developers, FYI
Source is from git as June 17.
[ 29%] Building C object src/CMakeFiles/mediastreamer_voip.dir/
audiofilters/
Post by Robert Dyck
tonedetector.c.o
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
audiofilters/tonedetector.c:176:8:* *error: *‘*strncpy*’ specified
bound 8 equals
Post by Robert Dyck
destination size [*-Werror=stringop-trunca*
]
*strncpy(event.tone_name,tone_def->tone_name,sizeof(event.tone_name))*;
Hi,
same here while building linphone-desktop for linux with git master HEAD
after updating Debian testing to gcc8.
Regards, Bernd
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Nick Briggs
2018-07-29 20:51:44 UTC
Permalink
GCC 8 introduced the -Wstringop-truncation because failure to NUL terminate strings as a result of a "strncpy(dest, src, sizeof(dest))" often leads to later code wandering off the end of the unterminated destination string. strncpy()'s definition and behavior hasn't changed.

There's an article on it at https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/ <https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/>

I believe that the folks at Belledonne Communications do monitor this list.

-- Nick Briggs
Post by Robert Dyck
I believe it is due to a change in the C standard library. The warning means
that the new version of the function may truncate the string. This triggers a
warning. The linphone build system treats warnings as errors. I tried setting
"enable_strict" to no but it didn't help. cmake said it was an unused option.
I have my doubts that the developers monitor this list.
Rob D
Post by Robert Dyck
Post by Robert Dyck
Dear developers, FYI
Source is from git as June 17.
[ 29%] Building C object src/CMakeFiles/mediastreamer_voip.dir/
audiofilters/
Post by Robert Dyck
tonedetector.c.o
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
audiofilters/tonedetector.c:176:8:* *error: *‘*strncpy*’ specified
bound 8 equals
Post by Robert Dyck
destination size [*-Werror=stringop-trunca*
]
*strncpy(event.tone_name,tone_def->tone_name,sizeof(event.tone_name))*;
Hi,
same here while building linphone-desktop for linux with git master HEAD
after updating Debian testing to gcc8.
Regards, Bernd
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Bernd Kuhls
2018-07-31 22:21:05 UTC
Permalink
Post by Nick Briggs
GCC 8 introduced the -Wstringop-truncation because failure to NUL
terminate strings as a result of a "strncpy(dest, src, sizeof(dest))"
often leads to later code wandering off the end of the unterminated
destination string. strncpy()'s definition and behavior hasn't changed.
Hi,

one way to fix the problem is to disable the CMake option ENABLE_STRICT
in these submodules:

submodules/belle-sip
submodules/linphone
submodules/mediastreamer2

by patching each CMakeLists.txt like this:

-option(ENABLE_STRICT "Build with strict compile options." YES)
+option(ENABLE_STRICT "Build with strict compile options." NO)

Regards, Bernd
Robert Dyck
2018-08-01 01:09:41 UTC
Permalink
Yes, that was the workaround I used back in June when I reported the problem.
Using -DENABLE_STRICT=NO with ./prepare.py didn't work. cmake said it was not
used by the project.

Every month or so I update from git to see if linphone will compile cleanly.
In the meantime my favorite softphone is the decades old Twinkle. Are there
any distros that have a recent version of Linphone?
Post by Bernd Kuhls
Post by Nick Briggs
GCC 8 introduced the -Wstringop-truncation because failure to NUL
terminate strings as a result of a "strncpy(dest, src, sizeof(dest))"
often leads to later code wandering off the end of the unterminated
destination string. strncpy()'s definition and behavior hasn't changed.
Hi,
one way to fix the problem is to disable the CMake option ENABLE_STRICT
submodules/belle-sip
submodules/linphone
submodules/mediastreamer2
-option(ENABLE_STRICT "Build with strict compile options." YES)
+option(ENABLE_STRICT "Build with strict compile options." NO)
Regards, Bernd
_______________________________________________
Linphone-developers mailing list
https://lists.nongnu.org/mailman/listinfo/linphone-developers
Robert Dyck
2018-07-29 22:14:59 UTC
Permalink
Thank you for the clarification. However the problem remains. If this warning is treated as an
error we are stuck. I suppose CMakeLists.txt

Rob D

On Sunday, July 29, 2018 1:51:44 PM PDT Nick Briggs wrote:


GCC 8 introduced the -Wstringop-truncation because failure to NUL terminate strings as a result
of a "strncpy(dest, src, sizeof(dest))" often leads to later code wandering off the end of the
unterminated destination string. strncpy()'s definition and behavior hasn't changed.


There's an article on it at https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/[1]


I believe that the folks at Belledonne Communications do monitor this list.


-- Nick Briggs


On Jul 29, 2018, at 1:01 PM, Robert Dyck <***@telus.net[2]> wrote:


I believe it is due to a change in the C standard library. The warning means that the new version
of the function may truncate the string. This triggers a warning. The linphone build system
treats warnings as errors. I tried setting"enable_strict" to no but it didn't help. cmake said it was
an unused option.

I have my doubts that the developers monitor this list.Rob D

On Sunday, July 29, 2018 12:31:34 PM PDT Bernd Kuhls wrote:


Am Sun, 17 Jun 2018 14:22:29 -0700 schrieb Robert Dyck:


Dear developers, FYISource is from git as June 17.

[ 29%] Building C object src/CMakeFiles/mediastreamer_voip.dir/




tonedetector.c.o*/home/rdyck/Downloads/linphone-desktop/submodules/mediastreamer2/src/
audiofilters/tonedetector.c:* In function ‘*detector_process*’:*/home/rdyck/Downloads/linphone-
desktop/submodules/mediastreamer2/src/audiofilters/tonedetector.c:176:8:* *error: *‘*strncpy*’
specified




destination size [*-Werror=stringop-trunca*]*strncpy(event.tone_name,tone_def-
Post by Robert Dyck
tone_name,sizeof(event.tone_name))*;
Linphone-***@nongnu.org[3]


_Linphone-***@nongnu.org_






--------
[1] https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/
[2] mailto:***@telus.net
[3] mailto:Linphone-***@nongnu.org
Continue reading on narkive:
Loading...