NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/51955: incorrect varargs warning

>Number:         51955
>Category:       toolchain
>Synopsis:       incorrect varargs warning
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 06 14:55:00 +0000 2017
>Originator:     Thomas Klausner
>Release:        NetBSD 7.99.59
Curiosity is the very basis of education and if you tell me that 
curiosity killed the cat, I say only that the cat died nobly.
- Arnold Edinborough
Architecture: x86_64
Machine: amd64
When compiling varargs code, gcc sometimes reports incorrect varargs warnings.
It seems to be connected to -std=gnu++14.
$ cat >>

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

char* myprintf (const char *fmt, ...) {
    va_list ap;

    va_start (ap, fmt);
    va_end (ap);
    return NULL;
$ g++   -std=gnu++14  -c -o example.o In function â??char* myprintf(const char*, ...)â??: warning: second parameter of â??va_startâ?? not last named argument [-Wvarargs]
     va_start (ap, fmt);

$ g++   -std=gnu++11  -c -o example.o


Home | Main Index | Thread Index | Old Index