The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: nadie on May 20, 2005, 04:01:01 PM

Title: warning A4006: too many arguments in macro call
Post by: nadie on May 20, 2005, 04:01:01 PM
 :'( please help us, we´re trying to make a server client program

this is the code

.486                                    ; Crea codigo de 32 bits
    .model flat, stdcall                    ; 32 bit Modelo de memoria
    option casemap :none                    ; case sensitive

    include \masm32\include\windows.inc     ; Librerias de windowns
    include \masm32\macros\macros.asm       ; Macros preconstruidos

  ; --------------------------------------------------
  ; include archivos para el llamado de las funciones
  ; --------------------------------------------------
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\wsock32.inc

  ; ------------------------------------------------
  ; Librerias con funciones
  ; ------------------------------------------------
    includelib \masm32\lib\masm32.lib
    includelib \masm32\lib\gdi32.lib
    includelib \masm32\lib\user32.lib
    includelib \masm32\lib\kernel32.lib
    includelib \masm32\lib\wsock32.lib

and this is the error

Assembling: C:\masm32\chat\Client.asm
\masm32\include\wsock32.inc(84) : warning A4006: too many arguments in macro call
switch(1): Macro Called From
  \masm32\include\wsock32.inc(84): Include File
\masm32\include\wsock32.inc(84) : error A2008: syntax error : PROTO
switch(1): Macro Called From
  \masm32\include\wsock32.inc(84): Include File


Title: Re: warning A4006: too many arguments in macro call
Post by: mnemonic on May 20, 2005, 04:06:12 PM
Posting the erroneous code would be helpful ::) :wink

EDIT:
Welcome in here, btw :8)
Title: Re: warning A4006: too many arguments in macro call
Post by: pbrennick on May 20, 2005, 04:23:25 PM
nadie,
There is not much that we can do to help you at this point.  Can you attach the .asm file (or the entire project)?

Paul
Title: Re: warning A4006: too many arguments in macro call
Post by: nadie on May 20, 2005, 05:23:58 PM
thanks for all, here is the code and .exe

[attachment deleted by admin]
Title: Re: warning A4006: too many arguments in macro call
Post by: mnemonic on May 20, 2005, 06:25:02 PM
Hi nadie,

because you included the macros.asm file before the wsock32.inc masm thinks that "select" is an alias for the "switch" macro and not the wsock function.
I was looking for some directive like "undef" for C but I just found "purge" which seems to do the same job in masm.
You should purge "select" after the include for macro.asm and before the include for wsock32.inc.

E.g.:
[...]
    .486                                    ; Crea codigo de 32 bits
    .model flat, stdcall                    ; 32 bit Modelo de memoria
    option casemap :none                    ; case sensitive

    include \masm32\include\windows.inc     ; Librerias de windowns
    include \masm32\macros\macros.asm       ; Macros preconstruidos
    purge select

  ; --------------------------------------------------
  ; include archivos para el llamado de las funciones
  ; --------------------------------------------------
    include \masm32\include\masm32.inc
    include \masm32\include\gdi32.inc
    include \masm32\include\user32.inc
    include \masm32\include\kernel32.inc
    include \masm32\include\wsock32.inc
[...]


Then it will assemble without probs.

Regards
Title: Re: warning A4006: too many arguments in macro call
Post by: MichaelW on May 20, 2005, 06:51:26 PM
Both files assemble without error on my system, whether macros.asm is included before or after wsock32.inc and wsock32.lib.
Title: Re: warning A4006: too many arguments in macro call
Post by: pbrennick on May 20, 2005, 07:56:58 PM
Hi nadie,
The suggestion made by mnemonic works fine.  I tried several other things and the best I ever got was a symbol redefinition error (select)

Anyway, use purge select and also remove

    include \masm32\include\user32.inc

and

    includelib \masm32\lib\user32.lib

as they are not being used and will generate a warning.

hth,
Paul

Title: Re: warning A4006: too many arguments in macro call
Post by: MazeGen on May 20, 2005, 09:54:38 PM
BTW, there nothing like "undef" in MASM unfortunately, not even "purge" works that way. Purge just makes the macro blank.

The worsest thing is you can't undefine text macro in MASM :( All you can do is redefine it using some tricks.
Title: Re: warning A4006: too many arguments in macro call
Post by: nadie on May 26, 2005, 02:58:50 PM
thanks for the help, the error message dont appear, but when i run the program, it show "cant initialize the winsock.dll",  please help me.

Nadie  :'(
Title: Re: warning A4006: too many arguments in macro call
Post by: Ramon Sala on June 01, 2005, 09:16:04 AM
Hi nadie,

To avoid errors working with winsock functions, you must download the last version of MASM32 (8.2) and the corresponding last service pack.

Ramon