Thread View: gnu.g++.bug
2 messages
2 total messages
Started by Robert Collins
Tue, 02 Jan 1990 19:25
const functions made local
Author: Robert Collins
Date: Tue, 02 Jan 1990 19:25
Date: Tue, 02 Jan 1990 19:25
56 lines
1702 bytes
1702 bytes
I am on a Sun4/330, running SunOS 4.0.3.
The problem is that when I declare a function to be const, it is made local,
rather than global. Naturally, this precludes using it from another file,
as the link fails. Am I declaring this incorrectly, or is this a bug, or
both?
Thanks,
rob collins
rjc@cs.ucla.edu
Script started on Tue Jan 2 11:18:40 1990
regulus% cat a.cc
extern const int foo(int);
extern int bar(int);
const int foo(int i)
{
return i;
}
int bar(int i)
{
return i;
}
regulus% g++ -v -O -S a.cc
gcc version 1.36.1 (based on GCC 1.36)
/usr/local/lib/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__OPTIMIZE__ a.cc /usr/tmp/cca05264.cpp
GNU CPP version 1.36
/usr/local/lib/gcc-cc1plus /usr/tmp/cca05264.cpp -quiet -dumpbase a.cc -O -version -o a.s
GNU C++ version 1.36.1 (based on GCC 1.36) (sparc) compiled by GNU C version 1.36.
default target switches: -mfpu -mepilogue
regulus% cat a.s
gcc_compiled.:
.text
.align 4
.proc 1
_foo__Fi:
!#PROLOGUE# 0
save %sp,-112,%sp
!#PROLOGUE# 1
ret
restore
.align 4
.global _bar__Fi
.proc 1
_bar__Fi:
!#PROLOGUE# 0
save %sp,-112,%sp
!#PROLOGUE# 1
ret
restore
regulus% ^D
script done on Tue Jan 2 11:19:34 1990
const functions made local
Author: Micheal Tiemann
Date: Tue, 02 Jan 1990 19:37
Date: Tue, 02 Jan 1990 19:37
3 lines
480 bytes
480 bytes
It's a bug. I'll fix it. Michael
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads