[freetds] Compilation issues when compiling under HP-UX B.11.31.

Frediano Ziglio freddy77 at gmail.com
Tue Mar 29 07:42:18 EDT 2016

2016-03-28 16:39 GMT+01:00 Mike Jetzer <mjetzer.cdc at gmail.com>:
> Two compilation issues with freetds-0.95.89 (as well as .88 and .80) when
> compiling under HP-UX B.11.31 with the "HP C/aC++ B3910B A.06.20 [May 13
> 2008]" compiler in 32-bit mode.  Both have simple work-arounds which are
> fine for my requirements, but I thought I'd report them to be addressed
> when time permits.
> src/tds/token.c generates a 'warning #2513-D: a value of type "int" cannot
> be assigned to an entity of type "char *" because <alloca.h> has not been
> #included:
>         nbcbuf = alloca((info->num_cols + 7) / 8);
>                ^
> Simply adding an "#include <alloca.h>" to token.c solves the issue.  I did
> not include a patch file because I imagine that this would most properly be
> resolved via configure/config.h rather than unconditionally adding it to
> token.c.  (In the version of Linux I use, <stdlib.h> performs an #include
> of <alloca.h> with the default compiler defines, so a prototype is present
> and gcc produces no similar warning.)

Fixed. I added AC_FUNC_ALLOCA in configure and proper headers

> The second issue is with src/dblib/dbpivot.c, which generates a large
> number of 'error #2136: struct "col_t" has no field "XX" errors due to the
> anonymous union in struct col_t's definition.  A Google search implies that
> anonymous unions were once a gcc extension but were adopted in C11; the
> HP-UX compiler only accepts up to and including C99.
> My work-around was to assign a name to the union and then update references
> to the union members with this union name.  I am not including a patch
> because I just named the union "x" and do not know what a more logical name
> for the union might be.

Named as "data".
Tomorrow snapshot should work without problems


More information about the FreeTDS mailing list