www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/09/14/23:09:05

Date: Wed, 14 Sep 1994 18:41:46 -0400
To: djgpp AT sun DOT soe DOT clarkson DOT edu
From: goliver AT magnus DOT acs DOT ohio-state DOT edu (Guy L. Oliver)
Subject: #pragma interface and implementation ???

Hello,

Recently, I was experimenting with the use of the pragma directives
interface and implementation.  It was my understanding that the outcome of
using these directives would be as follows.  When adding the line #pragma
interface to the beginning of a header file, other files could inlcude this
file, and then use it only as an interface, thus reducing the size of that
modules object file as it  skipped the creation of backup inline's,
debugging info, etc...

Also, when a file includes the above mentioned file using the directive
#pragma implementation, the steps skiped above will not be skipped, and the
resultant object file will have the full info in it.  

Acording to the info files on the subject, if a file and its header have the
same base name, #pragma implementation is implied.  Therefore, adding the
line #pragma implementation should have no effect on the output of the
compiler.  Yet, when I tried compiling a file and its like named header
file, with pragma interface in the header file, and pragma implementation in
the source file, I recieved a larger object file than I did if I left the
pragma implementation out of the source file.  Does any one know if this is
suposed to happen??  

From my understanding of the #pragma interface and implementation, the
object file should have been the same size, since #pragma implementation is
implied when the base name of the files are the same.  Since they were not
the same size, this would imlply to me that either the pragma implementation
is being processed along with the implied #pragma command, and the data that
it would allow to be generated is being added twice, (which I find
unlikely), or that the implied #pragma implementation is not being applied
when the base names are the same.

Any one have any ideas???

Thanks

Guy
------------------------------------------------------------------------------
Guy Oliver                                           The Ohio State University
goliver AT cis DOT ohio-state DOT edu                           oliver AT cis DOT ohio-state DOT edu
------------------------------------------------------------------------------


- Raw text -


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