Skip to content

struc causes warning which becomes fatal with -Wall -Werror #174

@dargueta

Description

@dargueta

On NASM 3.01, when running with the -Wall and -Werror options, assembly fails if the code contains a struc definition. This worked just fine on 2.x.

To reproduce, take the example from the docs (section 6.11.1) and add an instruction so NASM has something to do:

struc   mytype

  mt_long:      resd    1
  mt_word:      resw    1
  mt_byte:      resb    1
  mt_str:       resb    32

endstruc

nop

Assembly will fail:

% nasm -f bin -o output -Wall -Werror example.asm 
example.asm:8: error: unknown warning name: push [-w+error=unknown-warning]
example.asm:8: error: unknown warning name: pop [-w+error=unknown-warning]

If you run it through the preprocessor (just -E) you can see that the warning directives get added in:

%line 1+1 example.asm
[absolute 0]
%line 1+0 example.asm
mytype:
%line 2+1 example.asm

 mt_long: resd 1
 mt_word: resw 1
 mt_byte: resb 1
 mt_str: resb 32

mytype_size equ ($-mytype)
%line 8+0 example.asm
[warning push]
[warning -other]
[section .text]
[warning pop]
%line 9+1 example.asm

nop

It appears NASM doesn't support the [warning push] and [warning pop] directives, but the macro package shipped with it uses it anyway?

Platform:

  • NASM: 3.01
  • OS: Gentoo Linux (kernel 6.12.57)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions