delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/04/02/04:27:42

Date: Sat, 02 Apr 1994 03:58:08 -0500 (EST)
From: "Wonkoo Kim, EE, U. of Pittsburgh" <WKIM AT vms DOT cis DOT pitt DOT edu>
Subject: Re: storage allocation of global var
To: WKIM AT vms DOT cis DOT pitt DOT edu
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

>Date: Sat, 02 Apr 1994 00:11:32 -0500 (EST)
>From: "Wonkoo Kim, EE, U. of Pittsburgh" <WKIM AT vms DOT cis DOT pitt DOT edu>
>Subject: RE: storage allocation of global var
>
>>Date: Fri, 01 Apr 1994 17:19:52 -0500
>>From: dj AT ctron DOT com (DJ Delorie)
>>Subject: RE: storage allocation of global var
>>
>>What I do is this (in one of the .c files):
>>
>>	#define extern
>>	#include "something.h"
>
>Yes, this seems to be a better way!
>
>I thought this would not work in my case, but on the second thought, I 
>think this would work well if I look 'extern' symbol in something.h.

Following up to my own post, I found that I shouldn't define 'extern' itself 
as something.h may include another *.h that may contain 'extern' which 
shouldn't be touched.  So, I went back to my original way.

One thing that I'm still wondering is, why include\*.h in gcc or bcc do not
have 'extern' specifier for function protocols, but C books[K&R] say that
'extern' is required if it is external.  Is there some difference between
builtin *.h and user written *.h?  Or, just omitted 'extern' from
include\*.h because of implicit extern capability of the compiler/linker
when a function is external to a module but included .h has the non-extern
function protocol? 

Thanks.

Wonkoo Kim
wkim AT vms DOT cis DOT pitt DOT edu


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019