home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gcc / bug / 2335 < prev    next >
Encoding:
Text File  |  1992-09-14  |  1.3 KB  |  47 lines

  1. Newsgroups: gnu.gcc.bug
  2. Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!think.com!garyo
  3. From: garyo@think.com (Gary Oberbrunner)
  4. Subject: Any use of stdarg causes compiler warnings with -Wcast-align
  5. Message-ID: <9209142041.AA06026@prometheus.think.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 14 Sep 1992 20:41:39 GMT
  10. Approved: bug-gcc@prep.ai.mit.edu
  11. Lines: 34
  12.  
  13. When I use stdarg in a program and compile it with gcc 2.2.2 on my Sun4c
  14. running 4.1.2, I get these warnings:
  15.  
  16. draw_func.c:107: warning: cast increases required alignment of target type
  17. draw_func.c:107: warning: cast increases required alignment of target type
  18.  
  19. Two per line on which "va_arg" appears.
  20.  
  21. Test prog:
  22.  
  23.   #include <stdarg.h>
  24.   int main(int a, ...) 
  25.   {
  26.   va_list va;
  27.   int foo;
  28.   va_start(va, a);
  29.   foo = va_arg(va,int);
  30.   return 0; 
  31.   }
  32.  
  33. Compile like this:
  34.   % gcc -c -Wcast-align foo.c
  35.   foo.c:7: warning: cast increases required alignment of target type
  36.   foo.c:7: warning: cast increases required alignment of target type
  37.   %
  38.  
  39. I presume this is a problem with the implementation of the va_arg macro.
  40.  
  41.                 - Gary Oberbrunner
  42.                 Thinking Machines Corporation
  43.                 245 First St
  44.                 Cambridge, MA 02142
  45.                 garyo@think.com
  46.  
  47.