https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77590

            Bug ID: 77590
           Summary: va_arg() returns 0
           Product: gcc
           Version: 6.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: negge at dgql dot org
  Target Milestone: ---

Created attachment 39619
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=39619&action=edit
test_va.c

The va_arg() command always returns 0 (NULL) for this test_va.c program when
compiled as a 16bit DOS com file with the following command:

gcc -o test_va.com -std=gnu99 -Wall -Wextra -Os -nostdlib -m16 -march=i386 \
 -masm=intel -Wno-unused-function -ffreestanding -fomit-frame-pointer -fwrapv \
 -fno-strict-aliasing -fno-leading-underscore -Wl,--nmagic,-static,-Tcom.ld \
 test_va.c

The expected output is

C:\>TEST_VA.COM
Hello World

C:\>

but instead it produces

C:\>TEST_VA.COM
Hello Í ÿ

Reply via email to