News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Duplicate Arguments names

Started by theunknownguy, March 22, 2010, 11:49:21 PM

Previous topic - Next topic

theunknownguy

Ok after closing all "ASSUMES" that i forget still the bugs here the list:

V-ItemSetValues.asm(326) : Error A2160: Conflicting parameter definition:
V-ItemSetValues.asm(326): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(417) : Error A2160: Conflicting parameter definition:
V-ItemSetValues.asm(417): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(569) : Error A2062: Symbol already defined: ItemType
V-ItemSetValues.asm(569): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(569) : Error A2062: Symbol already defined: ItemIndex
V-ItemSetValues.asm(569): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(675) : Error A2062: Symbol already defined: ItemType
V-ItemSetValues.asm(675): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(675) : Error A2062: Symbol already defined: ItemIndex
V-ItemSetValues.asm(675): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(755) : Error A2160: Conflicting parameter definition:
V-ItemSetValues.asm(755): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(781) : Error A2062: Symbol already defined: ItemType
V-ItemSetValues.asm(781): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(781) : Error A2062: Symbol already defined: ItemIndex
V-ItemSetValues.asm(781): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(812) : Error A2062: Symbol already defined: ItemType
V-ItemSetValues.asm(812): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemSetValues.asm(812) : Error A2062: Symbol already defined: ItemIndex
V-ItemSetValues.asm(812): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code
V-ItemActions.asm(82) : Error A2062: Symbol already defined: ItemType


Ill do what qWord say and search in other files if meaby i declare a global variable called ItemType...

clive

With MASM the -Fl option (F L) generates a listing file, at the end you get the procedures parameters/locals, and global symbols. This might provide some hints to the namespace and scope of certain variables.

If the simple example I posted assembles on MASM/JWASM, it could be you have closure issue like Hutch's examples where the scope of some variable exceeds the procedure limits , of Qword's variables with global scope.

-Clive
It could be a random act of randomness. Those happen a lot as well.

clive

V-ItemSetValues.asm(326) : Error A2160: Conflicting parameter definition:
V-ItemSetValues.asm(326): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code

What is going on at these lines, do you have some kind of circular inclusion going on? Look at what's going on in procedures immediately before the erroring ones.

-Clive
It could be a random act of randomness. Those happen a lot as well.

theunknownguy

Quote from: clive on March 23, 2010, 12:43:25 AM
V-ItemSetValues.asm(326) : Error A2160: Conflicting parameter definition:
V-ItemSetValues.asm(326): Included by
  V-RestInc.inc(62): Included by
   V-GameServer.asm(31): Main line code

What is going on at these lines, do you have some kind of circular inclusion going on? Look at what's going on in procedures immediately before the erroring ones.

-Clive

I remove the PROTO from the file i used this procedure, since they dont need PROTO (the file that calls them is below) and the Conflict parameter error is gone...

I make the list file with -FL options and searching i found only a structure defined before with the names:

00000000                   ITEM_ATTRIBUTE_STRUCT struct
00000000                    ItemType Byte ?
00000001                    ItemIndex Byte ?


Does this affect?...

Also come to my mind that ITEMTYPE (caps) its used by some windows include i think...

But its ITEMTYPE and not ItemType has i use... can be this a problem?
   

theunknownguy

Fixed, the problem was in a procedure the last 2 lines i used example:

mov ItemIndex, eax
mov ItemType, edx


Without declaring ItemIndex and ItemType in the procedure arguments.

Its hard to detect bugs when your coding lines are more than 8.000 and keep growing >.<.

Thanks to all for the fast response, especially to u clive, you really good help ^^

qWord

Quote from: theunknownguy on March 23, 2010, 01:47:48 AMIts hard to detect bugs when your coding lines are more than 8.000 and keep growing
splitting your program in modules may helps to keep track of it.
FPU in a trice: SmplMath
It's that simple!

theunknownguy

Quote from: qWord on March 23, 2010, 02:27:09 AM
Quote from: theunknownguy on March 23, 2010, 01:47:48 AMIts hard to detect bugs when your coding lines are more than 8.000 and keep growing
splitting your program in modules may helps to keep track of it.

What you mean with modules, i mean i have alot of files, but most of my errors compiler never show me the "good line".

Its something odd that happens in allmost all big projects i do, sometimes compiler (MASM & JWASM) show me wrong lines number... >.<

qWord

a module means here to compile asm-files separately to object files (*.obj). This modules then combined to  one program by the linker. An short example:
module1.asm
include masm32rt.inc
externdef mySharedDword:DWORD ; this variable is initialized in an other module
ExternFunction PROTO

.code
start:
invoke ExternFunction

print "mySharedDword = "
mov eax,mySharedDword
print str$(eax),10,13
inkey
exit
end start

module2.asm
include masm32rt.inc

externdef mySharedDword:DWORD ; this variable is declared as extern, but initialized in this module
ExternFunction PROTO

.data
mySharedDword dd 1234
.code
ExternFunction proc
print "extern function called",10,13
ret
ExternFunction endp
end


assemble: each module separately
link: link.exe /SUBSYSTEM:CONSOLE /OUT:"Main.exe" "module1.obj" "module2.obj"

One advantage is that variables are only visible in current module (as long as you don't make them visible to other modules through the use of extern/externdef).
The normal way is to create one include file with definition of struct's, (global) variables and function prototypes. This file is then used in all modules.

FPU in a trice: SmplMath
It's that simple!

theunknownguy

Thanks qWord ill give it a try  :cheekygreen:

jj2007

Quote from: qWord on March 23, 2010, 02:27:09 AM
Quote from: theunknownguy on March 23, 2010, 01:47:48 AMIts hard to detect bugs when your coding lines are more than 8.000 and keep growing
splitting your program in modules may helps to keep track of it.

You would need an IDE that searches redefined or undefined symbols across all your files. IMHO it is easier to chase a bug if you keep it all in one fat file. Above 100,000 lines that might change, of course...