Patch #688
src/futils.cpp: incorrect check for linux version of strerror_r
100%
Description
&& should be instead ||
Files
Related issues
History
Updated by Andreas Huggel over 11 years ago
Can you elaborate why that should be changed?
According to the autoconf doc, STRERROR_R_CHAR_P may be set on 'many systems (including, for example, version 2.2.4 of the GNU C Library)'
and the _GNU_SOURCE is needed according to the Debian bug referenced in the source code.
What exactly is the problem you're seeing with the current code?
Updated by Nikolai Saoukh over 11 years ago
I think there is a need for little bit different test (in cmake file) for STRERROR_R_CHAR_P.
What about this one
--- cut here ---
#include <string.h>
int
dfunc()
{
char cb12;
return *(strerror_r(1, cb, sizeof(cb))) == '\0';
}
--- cut here ---
Updated by Nikolai Saoukh over 11 years ago
Reading debian bug info I got impression that _GNU_SOURCE is always defined for g++ (not plain gcc) case. I guess the check "|| defined _GNU_SOURCE" should be removed at all.
Updated by Nikolai Saoukh over 11 years ago
- File strchar.patch strchar.patch added
Well,
attached is better ;-) patch. It has better/stronger check for return type of strrerror_r, check done with proper compiler. There is no need for defined(_GNU_SOURCE).
Updated by Andreas Huggel over 11 years ago
- Category set to build
- Status changed from New to Resolved
- Target version set to 0.20
- % Done changed from 0 to 100
Checked in the change to the cmake config file (without spending too much time trying to understand it). Thanks.
Haven't checked in the change to the source file though. The official build system is still autoconf and that wasn't modified. Further, I still don't see how that define is a problem.
Updated by Nikolai Saoukh over 11 years ago
An _GNU_SOURCE check in src/futils.cpp is still the obstacle for compilation. Can someone sched the light for futils.cpp patch rejection?
Updated by Gilles Caulier over 11 years ago
Nikolai Saoukh wrote:
An _GNU_SOURCE check in src/futils.cpp is still the obstacle for compilation. Can someone sched the light for futils.cpp patch rejection?
Yes, your patch compile under Linux and GCC.
I will check Mingw and MSVC under Windows
Gilles Caulier
Updated by Gilles Caulier over 11 years ago
Gilles Caulier wrote:
Nikolai Saoukh wrote:
An _GNU_SOURCE check in src/futils.cpp is still the obstacle for compilation. Can someone sched the light for futils.cpp patch rejection?
Yes, your patch compile under Linux and GCC.
I will check Mingw and MSVC under Windows
Gilles Caulier
All compile fine under MSVC and Mingw for Windows
Patch about _GNU_SOURCE is applied to svn trunk...
Gilles Caulier
Updated by Robin Mills over 8 years ago
- Status changed from Resolved to Closed
- Assignee set to Gilles Caulier
- Target version set to 0.24
Fixed in 0.24.
#688: Stronger check for return type of strrerror_r. (Nikolai Saoukh)