[comp.unix.aix] Elm 2.3 PL11 compilation trouble

stevef@bony1.bony.com (Steve Faiwiszewski) (06/04/91)

I've seen messages on comp.unix.aix from People saying they had no
problems compiling Elm on the RS/6000.  Yet, I had to comment out all
declarations of string functions (e.g. strcpy, strchr, etc.), or else
the compiler would generate the error:

1506-041: (S) Parameter list cannot contain fewer parameters than
required by macro definition.

I was building Elm 2.3 PL11.  Am I doing anything wrong?

        - Steve -


-- 
=======================================================================
Internet: stevef@bony1.bony.COM  |          The Bank Of New York
                                 |          ~~~~~~~~~~~~~~~~~~~~        
bang : uunet!bony1!stevef        |        Reality is Nobody's Dream

woan@repulse.austin.ibm.com (Ronald S. Woan) (06/04/91)

In article <1991Jun3.175608.3435@bony1.bony.com> stevef@bony1.bony.com (Steve Faiwiszewski) writes:
>I've seen messages on comp.unix.aix from People saying they had no
>problems compiling Elm on the RS/6000.  Yet, I had to comment out all
>declarations of string functions (e.g. strcpy, strchr, etc.), or else
>the compiler would generate the error:

If you had used the bsdcc from the bsdport document in /usr/lpp/bos,
you wouldn't have had to go through this.

>1506-041: (S) Parameter list cannot contain fewer parameters than
>required by macro definition.

You'll notice that strcpy and strcmp are defined as macros in
/usr/include/string.h, so you'll have to either can the redeclaration
or use -U__STR__ as a compiler undefine. Then again bsdcc would have
taken care of this for you. Another hint make sure that libcurses.a is
the only display library linked in...

-- 
+-----All Views Expressed Are My Own And Are Not Necessarily Shared By------+
+------------------------------My Employer----------------------------------+
+ Ronald S. Woan                woan@cactus.org or woan@austin.vnet.ibm.com +
+ other email addresses             Prodigy: XTCR74A Compuserve: 73530,2537 +

mdapoz@hybrid.UUCP (Mark Dapoz) (06/04/91)

In article <1991Jun3.175608.3435@bony1.bony.com> stevef@bony1.bony.com (Steve Faiwiszewski) writes:
>I've seen messages on comp.unix.aix from People saying they had no
>problems compiling Elm on the RS/6000.  Yet, I had to comment out all
>declarations of string functions (e.g. strcpy, strchr, etc.), or else
>the compiler would generate the error:
>
>1506-041: (S) Parameter list cannot contain fewer parameters than
>required by macro definition.
>
>I was building Elm 2.3 PL11.  Am I doing anything wrong?

Compile using the following flags:

	-D_NO_PROTO -D_NONSTD_TYPES -U_ANSI_C_SOURCE -U__STR__

thats works for PL10, no code modifications are necessary.  The -U__STR__ is
the improtant one for the string(3) declarations.
-- 
Mark Dapoz	home: mdapoz%hybrid@cs.toronto.edu	
		work: md@toronto.ibm.com   or  mdapoz@torvm3.vnet.ibm.com
Finger and toes, finger and toes, forty things we share, forty one if you
include the fact that we don't care.  - The Tragically Hip

dwatts@ki.UUCP (Dan Watts) (06/04/91)

In article <1991Jun3.175608.3435@bony1.bony.com> stevef@bony1.bony.com (Steve Faiwiszewski) writes:
>
>I've seen messages on comp.unix.aix from People saying they had no
>problems compiling Elm on the RS/6000.  Yet, I had to comment out all
>declarations of string functions (e.g. strcpy, strchr, etc.), or else
>the compiler would generate the error:
>
>1506-041: (S) Parameter list cannot contain fewer parameters than
>required by macro definition.


Ah yes, definitely a FAQ here.  I had the same problems till some
kind sole told me how to do it.

You need to use the compiler swtich   -U__STR__
The problem you're running into is that by default, all string functions
are inline.  You can't declare an inline function extern.

Once you link, you'll also run into problems.  you need to link with
-lcurses to get things to work properly.


-- 
################# National Nude Weekend, 13 & 14 July #################
# CompuServe: >INTERNET:uunet.UU.NET!ki.com!dwatts  Dan Watts         #
# UUCP      : ...!{uunet | wgc386}!ki.com!dwatts    Ki Research, Inc. #
################ New Dimensions In Network Connectivity ###############

sja@sirius.hut.fi (Sakari Jalovaara) (06/04/91)

To make elm on the RS/6000 I'd also suggest you put

	#include <sys/ioctl.h>

at the top of src/curses.c.  This helps elm figure out the number of
lines and columns on your terminal.

>>                                        Yet, I had to comment out all
>>declarations of string functions (e.g. strcpy, strchr, etc.), or else
>>the compiler would generate the error:
>
>If you had used the bsdcc from the bsdport document in /usr/lpp/bos,
>you wouldn't have had to go through this.

Well, bsdcc does help in this regard but it can also hurt you.  It
turns off little things like function prototypes in system include
files:

	% bsdcc -c t.c
	% cc -c t.c
	        6 |     fprintf ("hello\n");
	            ......................a.
	a - 1506-098: (E) Missing argument(s).
	%

I think finding bugs like that justifies the extra work on
net.programs (let alone my own stuff (bsdcc is even worse when
I'm writing something new.))

(Though the real fix to this particular strcpy problem would probably
be to change the compiler to use
	#pragma hey_compiler_this_is_the_string_copy_function (strcpy)
instead of
	#define strcpy(s1,s2) __inlined_strcpy((s1),(s2))
)
									++sja