home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!mcsun!hp4at!paul
- From: paul@hp4at.eunet.co.at (Paul Gillingwater)
- Subject: va_arg() with Zortech's C++ compiler strangeness
- Message-ID: <1992Dec23.220033.13666@hp4at.eunet.co.at>
- Organization: EUnet EDV Dienstleistungs GmbH A-1010 Wien Austria
- Date: Wed, 23 Dec 1992 22:00:33 GMT
- Lines: 35
-
- I'm using Zortech's C++ compiler version 2.1, although this segment of
- code is written in C. I seem to get a syntax error when I change from
- the default (small) memory model, to the C (compact) memory model.
-
- ztc -I.. -mc -b -p -c -DDOS -DANSI _VSSCANF
- ztc1b -I.. -mc -p -DDOS -DANSI -oC:\WINDOWS\TMP\ztc_JC7.tmp _VSSCANF
- char_ptr = va_arg (arg_ptr, char far*);
- ^
- "_VSSCANF.c", line 132 Syntax error: lvalue expected
- char_ptr = va_arg (arg_ptr, char *);
- ^
- "_VSSCANF.c", line 194 Syntax error: lvalue expected
-
- As you can see, I tried changing the pointer to a far pointer, which I
- is necessary to access objects outside the 64kb data segment. I under-
- stand that the C model supports a 64 kb code space and a 1 Mb data space.
- This code compiles just fine when compiled using S (small) model.
- BTW, the code is taken from the PDCurses library, which was posted to
- comp.sources.misc this month. I have it mostly working with the Zortech
- compiler, except for delay_output() and this memory model.
-
- This code segment then uses va_arg, which is a macro defined thus in
- stdarg.h:
-
- #define va_arg(ap,type) (*((type __ss *)(ap))++)
-
- As you can see, the macro uses a type of __ss *. I tried this, with
- the same result. Is this due to my limited understanding of variable
- argument macro implementations, or something flakey in Zortech's compiler?
-
- Please mail responses to me, as I don't have much time to read posts,
- and I'll summarize if there is interest.
- --
- Paul Gillingwater
- Home system: paul@actrix.co.at (Waffle)
-