2

A little background:

I'm trying to port some .ksh files that I have running on Solaris to run on Windows using Cygwin. There is a difference between the ksh implementation running on the Solaris box and the pdksh implementation that is easily installable in Cygwin that deals with subshells - you can check this question for the details if you'd like.

Because of this difference, I'm trying to build the AST toolkit found here because the binaries are no longer available from AT&T according to this question.

My Question:

When I try to build according to the instructions on the GitHub site, I wind up with an error compiling a file called fastfind.c:

+ cc -D_BLD_STATIC -D_BLD_DLL -D_BLD_ast -I. -I/ast-master/src/lib/libast -Icomp -I/ast-master/src/lib/libast/comp -Imisc -I/ast-master/src/lib/libast/misc -Iinclude -I/ast-master/src/lib/libast/include -Istd -I/ast-master/src/lib/libast/std -D_PACKAGE_ast -c /ast-master/src/lib/libast/misc/fastfind.c,
In file included from /ast-master/src/lib/libast/std/stdio.h:22:0,
    from ./ast_wchar.h:87,
    from /ast-master/src/lib/libast/include/regex.h:39,
    from /ast-master/src/lib/libast/misc/findlib.h:35,
    from /ast-master/src/lib/libast/misc/fastfind.c:77:
./ast_stdio.h:82:15: error: conflicting types for '_sfio_FILE'
 #define FILE  _sfio_FILE
               ^
./ast_stdio.h:80:24: note: previous declaration of '_sfio_FILE' was here
 typedef struct _sfio_s _sfio_FILE;
                        ^
mamake [lib/libast]: *** exit code 1 making fastfind.o

Lines 80-82 of the file ast_stdio.h are as follows:

80: typedef struct _sfio_s _sfio_FILE;
81:
82: #define FILE        _sfio_FILE

Also, the top of the ast_stdio.h file have this:

/* : : generated by proto : : */
/* : : generated from /ast-master/src/lib/libast/features/stdio by iffe version 2012-07-17 : : */

Lastly, here's my relevant cc information:

$ cc --version
cc (GCC) 5.4.0

A little disclaimer: my C is rusty as I've been a Java guy for the past 14 years. My understanding is that the #define directive gets evaluated by the preprocessor, so line 82 would essentially replace the string FILE with _sfio_FILE in the code, and the typedef line wouldn't be evaluated until actual compilation.

Obviously I'm wrong, or this error wouldn't be happening. And obviously this code compiles for someone, or it wouldn't have been released this way. Any insights as to what's going on here and how I can make this file compile are appreciated. I found this question which seems close to what I'm asking, but there's either something different between my case and that question's, or my C brain is not able to comprehend why that question should cover my particular situation.

Thanks for your time!

Community
  • 1
  • 1

1 Answers1

1

The error was due to a change in glibc. See Red Hat Bugzilla #1477082 for more information and what changes to source files are needed.

fpmurphy
  • 2,464
  • 1
  • 18
  • 22