<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: va_arg() alignment error on HP-UX 11i in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164521#M718100</link>
    <description>Thanks Mike, that clears this up nicely.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Rob</description>
    <pubDate>Fri, 16 Jan 2004 03:50:53 GMT</pubDate>
    <dc:creator>Rob Molnar</dc:creator>
    <dc:date>2004-01-16T03:50:53Z</dc:date>
    <item>
      <title>va_arg() alignment error on HP-UX 11i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164519#M718098</link>
      <description>I get the following warning when compiling &lt;BR /&gt;&lt;BR /&gt;va_list arglist;&lt;BR /&gt;int status &lt;BR /&gt;&lt;BR /&gt;  va_start (arglist, f_ptr);&lt;BR /&gt;  status = va_arg(arglist, int);&lt;BR /&gt;&lt;BR /&gt;in 64-bit mode on 11i:&lt;BR /&gt;&lt;BR /&gt;LP64 migration: Casting from loose to strict alignment: Resulting pointer may be misaligned.&lt;BR /&gt;&lt;BR /&gt;The problem being I can't see why!&lt;BR /&gt;&lt;BR /&gt;This does compile cleanly for char arguments, so it looks like va_arg is mistaking arglist as being single or word byte aligned, but I'm sure all is correctly setup for 8 byte (natural) alignment.&lt;BR /&gt;&lt;BR /&gt;Can anyone shed any light on this? - I've seen a similar question from about a year ago on this forum, but the ansewer just explained the theory, which I'm pretty clear on.&lt;BR /&gt;The puzzling thing is that he error seems to be ocurring in the parameter interpretation within va_arg itself?...&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;Rob</description>
      <pubDate>Wed, 14 Jan 2004 13:07:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164519#M718098</guid>
      <dc:creator>Rob Molnar</dc:creator>
      <dc:date>2004-01-14T13:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: va_arg() alignment error on HP-UX 11i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164520#M718099</link>
      <description>The va_arg definition is a big macro-&lt;BR /&gt;================================================================================&lt;BR /&gt;#    define va_arg(__list,__mode)        \&lt;BR /&gt; (sizeof(__mode) &amp;gt; 8l ?         \&lt;BR /&gt;   (( __list = (__va__list)(void*) ((char *)__list + ((long)__list&amp;amp;(0x8l))  +  \&lt;BR /&gt;     (_ROUNDUP_NEXT_DWORD(sizeof(__mode))))),   \&lt;BR /&gt;    (*((__mode *) ((char *)__list -                                 \&lt;BR /&gt;     (_ROUNDUP_NEXT_DWORD(sizeof(__mode))))))) :       \&lt;BR /&gt;   ((__list = (__va__list)(void*) ((char *)__list + sizeof(char *))),    \&lt;BR /&gt;    __is_aggregate(__mode) ?                                        \&lt;BR /&gt;      (*((__mode *) ((char *)__list - sizeof(char *)))):            \&lt;BR /&gt;      (*((__mode *) ((char *)__list - sizeof(__mode)))) ))&lt;BR /&gt;&lt;BR /&gt;Part of that macro is a cast from char * to __mode *.  When you use a __mode of int, the compiler complains about a cast from the less strictly aligned char * to the more strictly aligned int *.  It is really alright because the macro code is explicitly computing a correctly aligned pointer.  The compiler just can't work that out.</description>
      <pubDate>Thu, 15 Jan 2004 11:49:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164520#M718099</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2004-01-15T11:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: va_arg() alignment error on HP-UX 11i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164521#M718100</link>
      <description>Thanks Mike, that clears this up nicely.&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;Rob</description>
      <pubDate>Fri, 16 Jan 2004 03:50:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/va-arg-alignment-error-on-hp-ux-11i/m-p/3164521#M718100</guid>
      <dc:creator>Rob Molnar</dc:creator>
      <dc:date>2004-01-16T03:50:53Z</dc:date>
    </item>
  </channel>
</rss>

