🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52698

Problem with inline and gcc2.1

#52698
From: John Ellis
Date: Fri, 22 May 1992 10:00
60 lines
1514 bytes
Dear all,

I have a problem with using "inline" with gcc 2.1. Specifically, the
directive seems to be completely ignored. For example, the following
program refuses to compile for lack of the symbol "doit" :

/* test inline */
#include <stdio.h>

inline extern void doit(int a) 
{
    printf("\n Its %d\n", a);
}


int main()
{
    int b = 12;
    
    doit(b);
    
    return 0;
}


(With gcc 1.40 it compiles fine.)

This is on a Sparc 4/330, sunos 4.1.1.
The assembler output is

gcc2_compiled.:
.text
	.align 4
LC0:
	.ascii "\12 Its %d\12\0"
	.align 4
	.global _main
	.proc 1
_main:
	!#PROLOGUE# 0
	save %sp,-144,%sp
	!#PROLOGUE# 1
	call ___main,0
	nop
	mov 12,%o0
	st %o0,[%fp-20]
	ld [%fp-20],%o0
	call _doit,0
	nop
	mov 0,%i0
	b,a L2
L2:
	ret
	restore


So what is this "call _doit,0" doing there? Any ideas would be
appreciated.

John Ellis
Technical Details
Message-ID: <JRE.92May22110022@suprenum.supr.scm.liv.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!lucsand!anduin!jre

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,50071fe3da6809ea,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-05-22 16:59:46 PST
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!mucs!lucsand!anduin!jre
From: jre@supr.scm.liv.ac.uk (John Ellis)
Newsgroups: gnu.gcc.help
Subject: Problem with inline and gcc2.1
Message-ID: <JRE.92May22110022@suprenum.supr.scm.liv.ac.uk>
Date: 22 May 92 10:00:22 GMT
Distribution: gnu
Organization: Centre for Mathematical Software Research, Univ. Liverpool, UK
Lines: 60
Nntp-Posting-Host: supr.scm.liv.ac.uk
Nntp-Posting-User: jre