🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #1964

apparent bug involving g++-1.34.2 -fno-strict-prototype and gdb.3.1.2

#1964
From: Bill Mitchell
Date: Wed, 10 May 1989 06:30
83 lines
3543 bytes
I was experimenting with container classes in libg++-1.34.0 and I came across
a program that when compiled with "g++ -g -fno-strict-prototype" (version
1.34.2) makes gdb.3.1.2 core dump upon the command "break main".

This script reproduces the problem:

#!/bin/sh
cat >bug.cc <<X
#include <std.h>
#include "String.h"
#include "StringList.h"
StringListNode NilStringListNode;
main()
{
}
X
genclass String val List
g++ -v -g bug.cc
gdb.3.1.2 a.out <<X
break main
q
X
g++ -v -g -fno-strict-prototype bug.cc
gdb.3.1.2 a.out <<X
break main
q
X

Here's what running the script with "sh -x" produces:

+ cat 
#include <std.h>
#include "String.h"
#include "StringList.h"
StringListNode NilStringListNode;
main()
{
}
+ genclass String val List 
+ g++ -v -g bug.cc 
g++ version 1.34.2
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug.cc /tmp/cca14581.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-c++ /tmp/cca14581.cpp -quiet -dumpbase bug.cc -noreg -version -G -o /tmp/cca14581.s
GNU C++ version 1.34.2 (68k, MIT syntax) compiled by GNU C version 1.34.
 as -mc68020 /tmp/cca14581.s -o bug.o
 /usr/local/lib/gcc-ld++ -C -dc -dp -Bstatic /usr/local/lib/crt0+.o /usr/lib/Mcrt1.o bug.o -lg++ /usr/local/lib/gcc-gnulib -lg -lc
+ gdb.3.1.2 a.out 
break main
q
GDB 3.1.2, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /a/whm/nw/flow/bug/a.out...done.
Type "help" for a list of commands.
(gdb) Breakpoint 1 at 0x2112: file bug.cc, line 7.
(gdb) + g++ -v -g -fno-strict-prototype bug.cc 
g++ version 1.34.2
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 bug.cc /tmp/cca14593.cpp
GNU CPP version 1.34
 /usr/local/lib/gcc-c++ /tmp/cca14593.cpp -quiet -dumpbase bug.cc -fno-strict-prototype -noreg -version -G -o /tmp/cca14593.s
GNU C++ version 1.34.2 (68k, MIT syntax) compiled by GNU C version 1.34.
/usr/local/lib/g++-include/File.h:162: warning: inline declaration ignored for function with `...'

[ Lots more instances of the same warning deleted -- whm ]

StringList.h:163: warning: inline declaration ignored for function with `...'

[ Lots more instances of the same warning deleted -- whm ]

 as -mc68020 /tmp/cca14593.s -o bug.o
 /usr/local/lib/gcc-ld++ -C -dc -dp -Bstatic /usr/local/lib/crt0+.o /usr/lib/Mcrt1.o bug.o -lg++ /usr/local/lib/gcc-gnulib -lg -lc
+ gdb.3.1.2 a.out 
break main
q
GDB 3.1.2, Copyright (C) 1988 Free Software Foundation, Inc.
There is ABSOLUTELY NO WARRANTY for GDB; type "info warranty" for details.
GDB is free software and you are welcome to distribute copies of it
 under certain conditions; type "info copying" to see the conditions.
Reading symbol data from /a/whm/nw/flow/bug/a.out...done.
Type "help" for a list of commands.
(gdb) ../protobug.sh: 14601 Memory fault - core dumped
Technical Details
Message-ID: <167@sunquest.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!sunquest!whm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!sunquest!whm
From: whm@sunquest.UUCP (Bill Mitchell)
Newsgroups: gnu.g++.bug
Subject: apparent bug involving g++-1.34.2 -fno-strict-prototype and gdb.3.1.2
Message-ID: <167@sunquest.UUCP>
Date: 10 May 89 06:30:26 GMT
Organization: Sunquest Information Systems, Tucson
Lines: 83