🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Ron Reisor Thu, 08 Jun 1989 13:59
delete[] bug?
#2080
Author: Ron Reisor
Date: Thu, 08 Jun 1989 13:59
49 lines
1325 bytes
g++ 1.35.1- does not seem to be generating any code for the delete[] construct.

I wrote this small test program:

	int *x;

	main()
	{
		x = new int[10];
		delete[10] x;
	}

Then I compiled with g++:

	g++ -v -S -O t.cc

g++ version 1.35.1-
 /usr/local/lib/gcc-cpp -+ -v -undef -D__GNU__ -D__GNUG__ -D__cplusplus -Dmc6800
 0 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__OPTIMIZE__ -Dmc68020 t.cc
 /tmp/cca01781.cpp
 GNU CPP version 1.35
  /usr/local/lib/gcc-cc1plus /tmp/cca01781.cpp -quiet -dumpbase t.cc -opt -versio
  n -o t.s
  GNU C++ version 1.35.1- (68k, MIT syntax) compiled by GNU C version 1.35.


This is the resulting code generated:

	#NO_APP
	gcc_compiled.:
	.text
	.even
	.globl _main
	_main:
		link a6,#0
		pea 40:w
		jbsr ___builtin_new
		movel d0,_x
		unlk a6
		rts
	.comm _x,4

If I don't subscript the type when calling new or the delete operator,
___builtin_delete does get called.

cheers,

Ron
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