Bug 5860 - Error: too many positional arguments
Summary: Error: too many positional arguments
Status: RESOLVED WORKSFORME
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.15
: P2 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-04 06:01 UTC by Aparna Jain
Modified: 2009-01-24 04:44 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aparna Jain 2008-03-04 06:01:53 UTC
Hi,

I am trying to compile romInit.s in vxWorks. And I am getting too many errors 
of following type

../romInit.s:452: Error: too many positional arguments

The reason is the Macro definition does not take any space around operator

for ex:

li r3, MACRO_DEF

where as MACRO_DEF is
#define MACRO_DEF  (a + b)

#define a 0x1000
#define b 0x2000

To be able to compile successfully the above definition needs to be changed to


#define MACRO_DEF  (a+b)


#define a (0x1000)
#define b (0x2000)

it reduces readability and it is tedious to do for all MACROS lise this

thanks
aparna
Comment 1 Alan Modra 2008-03-04 09:53:43 UTC
Please attach a test case.  Your bug report doesn't make sense.  You say you are
using #define, ie. C preprocessor macros, but complain about a gas macro error
message.
Comment 2 Aparna Jain 2008-03-05 14:07:35 UTC
Subject: RE:  Error: too many positional arguments

Hi,

Thanks for the reply

Ok, sorry for the confusion.
I did not give complete details.

It normally happens when the defines are in a .macro definition

For ex:

An Asm instruction

 LOAD32  r4,FISRT_BLOCK_END

Where as
     .macro LOAD32 reg,val
        .if ((0xffff8000 <= (\val) ) && ( (\val) <= 0x00007fff))
         li     \reg, \val
        .else
         .if ~(\val) & 0xffff8000
          lis   \reg, HIADJ(\val)
         .else
          lis   \reg, 0x0000
         .endif
         .if (\val) & 0xffff
         addi  \reg, \reg, LO(\val)
         .endif
        .endif
        .endm

And

#define FISRT_BLOCK_END   (LOCAL_MEM_LOCAL_ADRS+EXC_MSG_OFFSET - 4)

Gives too many positional  argumnet error

If I change the definition to  
#define FISRT_BLOCK_END   (LOCAL_MEM_LOCAL_ADRS+EXC_MSG_OFFSET-4)

It is fine

I think there is a similar bug Id 1077, but still in open state

Thanks
aparna

-----Original Message-----
From: amodra at bigpond dot net dot au
[mailto:sourceware-bugzilla@sourceware.org] 
Sent: Tuesday, March 04, 2008 3:24 PM
To: Aparna Jain (apjain)
Subject: [Bug gas/5860] Error: too many positional arguments


------- Additional Comments From amodra at bigpond dot net dot au
2008-03-04 09:53 ------- Please attach a test case.  Your bug report
doesn't make sense.  You say you are using #define, ie. C preprocessor
macros, but complain about a gas macro error message.

-- 
           What    |Removed                     |Added
------------------------------------------------------------------------
----
             Status|NEW                         |WAITING


http://sourceware.org/bugzilla/show_bug.cgi?id=5860

------- You are receiving this mail because: ------- You reported the
bug, or are watching the reporter.
Comment 3 Alan Modra 2008-03-06 05:52:09 UTC
You still haven't attached a test case.  Your pasted code snippets will not
assemble without the definitions for HIADJ and LO.  Incidentally, the LOAD32
macro is broken on 64-bit hosts or when binutils is compiled with a 64-bit bfd.

If you can't post a complete testcase, please try a newer version of binutils. 
I think your problem has already been fixed.
Comment 4 Alan Modra 2009-01-24 04:44:42 UTC
Closing due to lack of response.