adg: fix type of va_start last parameter
commitdbe659447beb20ff96d03089546a5cd7c066c39f
authorNicola Fontana <ntd@entidi.it>
Mon, 26 Dec 2016 08:45:14 +0000 (26 09:45 +0100)
committerNicola Fontana <ntd@entidi.it>
Mon, 26 Dec 2016 08:45:14 +0000 (26 09:45 +0100)
treede6e7ce9deaf708b55ba71df40add818e049ed0c
parent9fc24da1bab8d59995d6dd019586c044c4a5aa9d
adg: fix type of va_start last parameter

Because the address of the last parameter may be used in the va_start()
macro, default argument promotions must not change the type of that
parameter. The compiler is free to implement enum as short int (or even
char), so this assumption will not be respected: short int and char
would be promoted to int. In this case the specification says the
behavior is undefined.

For some C99 reference regardling this topic see
http://stackoverflow.com/questions/24580503/error-when-pass-enum-in-a-function-with-variable-arguments

This was issue was highlighted by some strange failure of the test suite
with clang 3.9.0: https://travis-ci.org/ntd/adg/jobs/186622731
src/adg/adg-path.c
src/adg/adg-path.h