Project

General

Profile

Patch #688

src/futils.cpp: incorrect check for linux version of strerror_r

Added by Nikolai Saoukh over 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Category:
build
Target version:
Start date:
04 Mar 2010
Due date:
% Done:

100%

Estimated time:

Description

&& should be instead ||


Files

futils.patch (478 Bytes) futils.patch Nikolai Saoukh, 04 Mar 2010 08:22
strchar.patch (1.09 KB) strchar.patch Nikolai Saoukh, 08 Mar 2010 20:46

Related issues

Related to Exiv2 - Bug #692: Revision 2057 broke compilation under FreeBSD and WindowsClosed10 Apr 2010

Actions
Related to Exiv2 - Feature #536: Switch to a unified build system based on cmakeClosed

Actions
Related to Exiv2 - Bug #697: config/ConfigureChecks.cmake: STRERROR_R_CHAR_P revisited Closed20 Apr 2010

Actions

Associated revisions

Revision 2041 (diff)
Added by Andreas Huggel over 11 years ago

#688: Stronger check for return type of strrerror_r. (Nikolai Saoukh)

Revision 2076 (diff)
Added by Gilles Caulier over 11 years ago

apply patch from BUG #688

History

#1

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?

#2

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 ---

#3

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.

#4

Updated by Nikolai Saoukh over 11 years ago

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).

#5

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.

#6

Updated by Andreas Huggel over 11 years ago

  • Target version deleted (0.20)
#7

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?

#8

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

#9

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

#10

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.

Also available in: Atom PDF