Opened 9 years ago

Closed 8 years ago

#616 closed Bug / Defect (fixed)

Compilation error with --enable-pedantic

Reported by: stipa Owned by: Gert Döring
Priority: minor Milestone: release 2.4
Component: Building / Compiling Version: OpenVPN git master branch (Community Ed)
Severity: Not set (select this one, unless your'e a OpenVPN developer) Keywords:
Cc: Gert Döring

Description

With --enable-pedantic option enabled, compilation fails in compat-lz4.c:

compat-lz4.c:154:1: error: expected identifier or '(' before '/' token
 //**************************************
 ^

 compat-lz4.c:154:2: error: unterminated comment
 //**************************************
  ^

Change History (3)

comment:1 Changed 9 years ago by Gert Döring

Milestone: release 2.4
Owner: set to Gert Döring
Status: newaccepted

thanks. We've imported a somewhat oldish version of lz4.c from upstream, which wants a refresh anyway - so, I'll do, and check for these sort of "non-pretty" comments at that opportunity.

Relevant for 2.4, as 2.3 doesn't have lz4 at all.

(Workaround: install lz4 externally, where openvpn configure can find it, do not use the compat stuff :) )

comment:2 Changed 8 years ago by Gert Döring

a more recent version of the LZ4 sources has now been imported (r131)

commit 46e4b6639a950c56a08261b6610e7fe17404213d
Author: Gert Doering <gert@…>
Date: Thu Jun 9 13:51:29 2016 +0200

Upgrade bundled compat-lz4 to upstream release r131.

... but that still does not work with --enable-pedantic, as it uses "long long" which is not in C90. To make it work, change "-ansi" to "-std=c99".

A new patch for that will be sent shortly.

comment:3 Changed 8 years ago by Gert Döring

Resolution: fixed
Status: acceptedclosed

Haha, that was quick :-)

commit d16072cf17ce8debcf796565841a54f1253a9923
Author: Gert Doering <gert@…>
Date: Thu Jun 9 15:00:32 2016 +0200

Change --enable-pedantic to use -std=c99 and not -ansi (C90).

with that change, we still have a number of warnings related to -Wstrict-aliasing (which we can't do much about, as it's all sockaddr stuff) and a few signed/unsigned mismatches. But at least everything compiles :-)

Note: See TracTickets for help on using tickets.