After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 745858 - check: tempnam deprecated warning
check: tempnam deprecated warning
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal minor
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-03-08 22:01 UTC by Michał Dębski
Modified: 2015-03-11 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
change tempnam to mkstemp (1.88 KB, patch)
2015-03-08 22:01 UTC, Michał Dębski
committed Details | Review

Description Michał Dębski 2015-03-08 22:01:28 UTC
Created attachment 298834 [details] [review]
change tempnam to mkstemp

Using tempnam() gives warning and fails the build with -Werror.

check_msg.c:235:22: warning: 'tempnam' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead. [-Wdeprecated-declarations]
Comment 1 Michał Dębski 2015-03-08 22:05:35 UTC
There are also multiple warnings regarding unneeded -pthread argument to some libraries with clang:
clang: warning: argument unused during compilation: '-pthread'

How about adding -Wno-error=unused-command-line-argument?
Comment 2 Sebastian Dröge (slomo) 2015-03-09 07:44:16 UTC
(In reply to Michał Dębski from comment #1)
> There are also multiple warnings regarding unneeded -pthread argument to
> some libraries with clang:
> clang: warning: argument unused during compilation: '-pthread'
> 
> How about adding -Wno-error=unused-command-line-argument?

That one should be fixed by not passing -pthread if not needed. It seems to be something wrong with the pthread configure check.
Comment 3 Sebastian Dröge (slomo) 2015-03-11 16:12:32 UTC
commit a7797d30a857fe739f57103375608e3b999d980f
Author: Michał Dębski <debski.mi.zd@gmail.com>
Date:   Sun Mar 8 20:42:38 2015 +0100

    check: Use mkstemp instead of tempnam if possible
    
    Using tempnam() is deprecated, this gives warning and fails the build
    with -Werror.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745858
Comment 4 Sebastian Dröge (slomo) 2015-03-11 16:13:14 UTC
Can you also provide this patch to check upstream? http://check.sourceforge.net/
Comment 5 Michał Dębski 2015-03-11 19:56:30 UTC
Added:
https://sourceforge.net/p/check/patches/51/

Regarding -pthread argument warning this looks like clang specific case, take a look at this link:
http://stackoverflow.com/questions/17841140/os-x-clang-pthread

Removing flags from libraries supposedly linking with pthread removes this warning and does not break build on clang, but I'm not sure what would happen on gcc. It seems like there are some check in ax_pthread.m4, but it is leaving -pthread flags for linking:

common/m4/ax_pthread.m4:167
# Clang doesn't consider unrecognized options an error unless we specify
# -Werror. We throw in some extra Clang-specific options to ensure that
# this doesn't happen for GCC, which also accepts -Werror.

Then there are some checks, but I'm not familiar with autotools to fully understand what is happening.