[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

C89 bug when compiling on MinGW (not subscribed)

From: <carlo.bramix_at_libero.it>
Date: Sat, 5 Oct 2013 12:40:22 +0200 (CEST)

Hello,
I compiled successfully SVN on MINGW+MSYS but I got this error during the
process:

/bin/sh /home/Carlo/subversion-1.8.3/libtool --tag=CC --silent --mode=compile
gcc -std=c89 -DWIN32 -D__MSVCRT__ -D_LARGEFILE64_SOURCE -g -O2 -g -O2 -I.
/subversion/include -I./subversion -I/mingw/include/apr-1 -
I/mingw/include/apr-1 -o subversion/libsvn_subr/win32_xlate.lo -c
subversion/libsvn_subr/win32_xlate.c
subversion/libsvn_subr/win32_xlate.c:81: error: redefinition of typedef
'win32_xlate_t'
subversion/libsvn_subr/win32_xlate.h:30: error: previous declaration of
'win32_xlate_t' was here
subversion/libsvn_subr/win32_xlate.c: In function
`svn_subr__win32_xlate_to_stringbuf':
subversion/libsvn_subr/win32_xlate.c:205: warning: assignment makes pointer
from integer without a cast
make: *** [subversion/libsvn_subr/win32_xlate.lo] Error 1

Actually, the subversion/libsvn_subr/win32_xlate.h declares some functions
with an opaque structure called win32_xlate_t, but since the build process is
feeding the option "-std=c89", it fails because it seems that the opaque and
complete structures are not supported in that dialect at the same time.
Probably, this defect has been never seen before because perhaps until now SVN
for native Windows has been never compiled with GCC (cygwin is POSIX, not
WIN32, so it does not count).
The missing conformance to C89 can be resolved by either declaring the
complete structure inside subversion/libsvn_subr/win32_xlate.h, or by making
that parameter in those functions really opaque, with a pointer to void that it
will be eventually casted later to win32_xlate_t.

I have prepared two patches for this bug: each patch implements one of the two
solutions described above so you can use the best for you (anyways, they are
both easy fixes).

Sincerely,

Carlo Bramini.
Received on 2013-10-07 07:11:45 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.