🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #1141

Any use of stdarg causes compiler warnings with -Wcast-align

#1141
From: Gary Oberbrunner
Date: Mon, 14 Sep 1992 20:41
33 lines
1345 bytes
When I use stdarg in a program and compile it with gcc 2.2.2 on my Sun4c
running 4.1.2, I get these warnings:

draw_func.c:107: warning: cast increases required alignment of target type
draw_func.c:107: warning: cast increases required alignment of target type

Two per line on which "va_arg" appears.

Test prog:

  #include <stdarg.h>
  int main(int a, ...) 
  {
  va_list va;
  int foo;
  va_start(va, a);
  foo = va_arg(va,int);
  return 0; 
  }

Compile like this:
  % gcc -c -Wcast-align foo.c
  foo.c:7: warning: cast increases required alignment of target type
  foo.c:7: warning: cast increases required alignment of target type
  %

I presume this is a problem with the implementation of the va_arg macro.

				- Gary Oberbrunner
				Thinking Machines Corporation
				245 First St
				Cambridge, MA 02142
				garyo@think.com
Technical Details
Message-ID: <9209142041.AA06026@prometheus.think.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!think.com!garyo

Show Full Headers
Complete Article Headers
Newsgroups: gnu.gcc.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!think.com!garyo
From: garyo@think.com (Gary Oberbrunner)
Subject: Any use of stdarg causes compiler warnings with -Wcast-align
Message-ID: <9209142041.AA06026@prometheus.think.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Mon, 14 Sep 1992 20:41:39 GMT
Approved: bug-gcc@prep.ai.mit.edu
Lines: 34