[SAC-HELP] NetBSD falling foul of SAC's toupper/tolower macros
Kuang He
icrazy at gmail.com
Mon Sep 29 19:10:12 PDT 2008
Hi Keven,
I've reported the same problem a couple of weeks ago, and provided a patch.
http://www.iris.washington.edu/pipermail/sac-dev/2008-September/000088.html
This should be fixed in the next version.
Best regards,
--
Kuang He
Department of Physics
University of Connecticut
Storrs, CT 06269-3046
Tel: +1.860.486.4919
Web: http://www.phys.uconn.edu/~he/
On Mon, Sep 29, 2008 at 9:15 PM, <Kevin.Buckley at mcs.vuw.ac.nz> wrote:
> Hi there,
>
> I am sure this is a known issue but my searches turned up zilch
> so, just in case ...
>
> I came to build sac-101.2 on a NetBSD 4.99.58 platform with
> gcc (GCC) 4.1.3 20080202 prerelease (NetBSD nb1 20070620), the
> sac build being configured thus:
>
> ./configure --prefix=/local/scratch/kevin/sac-101.2
>
> resulting in:
>
> Compliation Options for sac (Seismic Analysis Code 101.2)
>
> CFLAGS =
> LDFLAGS =
> LIBS = -lm -lcurses
> Debug =
> Optimization =
> Database = off
> Matlab = off
> X11-buffer = on
> X11-depth = on
> X_LIBS = -L/usr/pkg/lib
> X_CFLAGS = -I/usr/pkg/include
> Readline = off
> Editline = on
> Install Base = /local/scratch/kevin/sac-101.2
> System = (i386-unknown-netbsdelf4.99.58)
>
>
> and saw this error:
>
> gcc -DHAVE_CONFIG_H -I. -I. -I../inc -I/usr/pkg/include -I../inc
> -I../libedit/include -c -o co/zgpmsg.o co/zgpmsg.c
> In file included from /usr/pkg/include/readline/chardefs.h:26,
> from /usr/pkg/include/readline/keymaps.h:36,
> from /usr/pkg/include/readline/readline.h:38,
> from co/zgpmsg.c:93:
> /usr/include/ctype.h:71: error: expected identifier or '(' before 'int'
> /usr/include/ctype.h:71: error: expected ')' before '?' token
> /usr/include/ctype.h:72: error: expected identifier or '(' before 'int'
> /usr/include/ctype.h:72: error: expected ')' before '?' token
>
> this occurs because the toupper/tolower declarations in this system's
> ctype.h
>
> int tolower(int);
> int toupper(int);
>
> get mangled by the macro declaration in sac's
>
> src/co/stdu.h
>
> #ifndef CYGWIN
> /* macro expansions */
> #define tolower(c) ((c>='A' && c<='Z') ? (c+('a'-'A')) : c)
> #define toupper(c) ((c>='a' && c<='z') ? (c-('a'-'A')) : c)
> #endif /* CYGWIN */
>
> as they are only protected by the CYGWIN define and so appear as:
>
> int ((int>='A' && int<='Z') ? (int+('a'-'A')) : int);
> int ((int>='a' && int<='z') ? (int-('a'-'A')) : int);
>
>
> After removing the macro definitions, the code compiles OK.
>
>
> --
>
> Kevin M. Buckley Room: CO327
> School of Mathematics, Statistics Phone: +64 4 463 5971
> and Computer Science
> Victoria University of Wellington
> New Zealand
>
> _______________________________________________
> sac-help mailing list
> sac-help at iris.washington.edu
> http://www.iris.washington.edu/mailman/listinfo/sac-help
>
More information about the sac-help
mailing list