Project

General

Profile

Patch #1362

Fix Clang build

Added by David Carlos Manuelda over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
build
Target version:
Start date:
04 Aug 2018
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Clang does not admit -std=gnu++98 for C, as it is a C++ flag, thus it fails with error despite gcc and other seems to accept it even in C mode.

The fix is pretty simple, by using CMAKE_C_FLAGS instead of ADD_DEFINITIONS for setting that flag (also ADD_DEFINITIONS is not supposed to use for other kind of flags which are not -DXXXX).


Files

fix-clang-build.patch (641 Bytes) fix-clang-build.patch David Carlos Manuelda, 04 Aug 2018 14:27

History

#1

Updated by Robin Mills over 3 years ago

  • Category set to build
  • Status changed from New to Assigned
  • Assignee set to Robin Mills
  • Target version set to 0.27
  • % Done changed from 0 to 10
  • Estimated time set to 2.00 h

Thanks for reporting this and providing the patch.

I'm very surprised by this because I use a Mac as my development machine on which the compiler is clang. I'll investigate your patch on Linux/clang and get back to you.

I'm on vacation at the moment and will do the work as time permits.

#2

Updated by David Carlos Manuelda over 3 years ago

An important fact is that it fails with clang-6, not with previous versions as the if condition above is not met.

#3

Updated by Robin Mills over 3 years ago

Ah. Thanks for letting me know about that detail.

You're welcome to submit a PR to https://github.com/exiv2/exiv2.git

#4

Updated by Robin Mills over 3 years ago

David

I'm on vacation in Montana, USA and can't get clang to download. I think something's blocking my internet connection. Can you submit a PR on https://github.com/exiv2/exiv2 and another member of Team Exiv2 will give this attention.

Robin

#5

Updated by David Carlos Manuelda over 3 years ago

Sure, will do tomorrow, thanks for your attention and enjoy your hollydays :)

#6

Updated by David Carlos Manuelda over 3 years ago

I've reviewed github repository, seems it is already fixed there, I was affected probably by an old snapshot of exiv2 for Gentoo.

Sorry for the inconvenience :)

#7

Updated by Robin Mills over 3 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 10 to 100
  • Estimated time changed from 2.00 h to 1.00 h

Thanks for the update, David. It's good to hear that this is working for you. Thank You for using Exiv2 and Thank You for engineering a patch.

Also available in: Atom PDF