Bug 38104
Summary: | gcc fails to compile programs if va_arg macro is used with types other than int | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Michael McTernan <mm7323> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.1 | ||
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-04-27 19:13:49 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Michael McTernan
2001-04-27 19:13:44 UTC
C promotes char and short to int when passing to ... arguments. The compiler is right to make it obvious this is a bug. A varargs function will simply never get a char or short as vararg, therefore if you want to pass a short through varargs, you should use (myType)va_arg(ap, int). Similarly with float (which is promoted to double). If there are programs which don't do this, they should be fixed. |