Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
3.3.17
-
None
Description
As found in the compulation of mysql.cc under clang in MDEV-36701
https://github.com/MariaDB/server/commit/3e43606de6a5c6a0ee180d9c6a0ee73b2480909a |
client/mysql.cc:3205:16: warning: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Wvarargs]
|
This was probably clang-20.
https://github.com/mamh-mixed/glusterfs/commit/11ea746
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf |
7.16.1.4p4
|
|
parmN is the identifier of the rightmost parameter in the variable
|
parameter list in the function definition (the one just before the , ...). If the parameter
|
parmN is declared ... with a type that is not compatible with the type that results after application of the default argument promotions, the behavior is undefined.
|
|
|
6.3.1.1p1
|
|
The rank of any enumerated type shall equal the rank of the compatible integer type
|
(see 6.7.2.2).
|
|
6.7.2.2p4
|
|
Each enumerated type shall be compatible with char, a signed integer type, or an
|
unsigned integer type. The choice of type is implementation-defined
|
So enums are undergoing a default argument promotion because they might be unsigned in my understanding.
I'm not sure if its resolvable. Might be possible to be an explicit int type because of the low range of values (does this affect bigendian?)
Attachments
Issue Links
- relates to
-
MDEV-37502 Make Server Debug + Clang compile ready
-
- Closed
-
- links to