bug-gnu-arch
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnu-arch] [bug #12751] stdarg missuse breaks on sparc-sun-solaris


From: anonymous
Subject: [Bug-gnu-arch] [bug #12751] stdarg missuse breaks on sparc-sun-solaris
Date: Wed, 20 Apr 2005 18:04:19 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12751>

                 Summary: stdarg missuse breaks on sparc-sun-solaris
                 Project: GNU arch -- a revision control system
            Submitted by: None
            Submitted on: Wed 04/20/2005 at 14:04
                Category: tla
                Severity: 3 - Normal
              Item Group: bug
                  Status: None
                 Privacy: Public
             Open/Closed: Open
                 Release: tla-1.3.1-fix-1
           Fixed Release: 
          Merge Request?: yes -- diffs included
       Your Archive Name: 
   Your Archive Location: 
             Assigned to: None

    _______________________________________________________

Details:

// OS:
//   SunOS codesign10 5.9 Generic_118558-01 sun4u sparc
//
// gcc:
//   Reading specs from
/sun-local/gnu/bin/../lib/gcc/sparc-sun-solaris2.9/3.4.2/specs
//   Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld --disable-nls
//   Thread model: posix
//   gcc version 3.4.2

// Testcase follows:

#include <stdarg.h>
#include <stdlib.h>


struct rel_record
{
    int _c;
};
typedef struct rel_record rel_record;

struct rel_table
{
    rel_record * _r;
};
typedef struct rel_table rel_table;

void
rel_add_records (rel_table * table, ...)
{
    va_list rp;
    rel_record r;

    va_start (rp, table);
    r = va_arg (rp, rel_record);
    while ( r._c )
      r = va_arg (rp, rel_record);
    va_end (rp);
}

int main( int argc, char *argv[] ) {
  rel_record r0 = { 12 };
  rel_record r1 = { 0 };

  rel_add_records (NULL, r0, r1); // ok

  // stdarg missuse breaks on SunOS
  rel_add_records (NULL, r0, 0); // segfaults
  return 0;
}






    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 04/20/2005 at 14:04  Name: tla-1.3.1-fix-1-sunfix.patch  Size:
81.96KB   By: None
Patch to fix bug
<http://savannah.gnu.org/bugs/download.php?item_id=12751&item_file_id=2423>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=12751>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]