Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #549

Re: combining c-code files into one c-code file

From Cameron McInally <cameron.mcinally@nyu.edu>
Newsgroups comp.compilers
Subject Re: combining c-code files into one c-code file
Date 2012-04-04 12:02 -0400
Organization Compilers Central
Message-ID <12-04-006@comp.compilers> (permalink)
References <12-04-005@comp.compilers>

Show all headers | View raw


Hey Harald,

No, I do not know of any tool that will do such things automatically.
But, a tool like this is not something that would be on my radar.

I do have a small bit to add though, which may make such a tool a tall
order. One immediate issue I see is determining linkage of symbols
when consolidating the source. When handling WEAK symbols, the link
line (and potentially the characteristics of your linker), will play a
role in determining which definition should be selected for each
reference. Whether you intend to link your program statically or
dynamically muddles the issue further.

At the very least, if your program is reasonably complex, this tool
you seek would need to have knowledge about the linker that you're
using on your system.

Hope that helps!,
Cameron

On Tue, Apr 3, 2012 at 9:23 AM, Harald Gustafsson
<harald.gustafsson@gmail.com> wrote:

> pre-process/merge that into one c-file, managing redeclarations, conflicting
> declarations, declaration order, etc. The readability of the output is less
> important but prefers as human readable as possible.
>
> An alternative is to have one file scope but separate each included c-file
> into its own namespace, does C99 have any such support?

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

combining c-code files into one c-code file Harald Gustafsson <harald.gustafsson@gmail.com> - 2012-04-03 06:23 -0700
  Re: combining c-code files into one c-code file Cameron McInally <cameron.mcinally@nyu.edu> - 2012-04-04 12:02 -0400
  Re: combining c-code files into one c-code file Harald Gustafsson <harald.gustafsson@gmail.com> - 2012-04-04 19:35 +0200
  Re: combining c-code files into one c-code file Gene <gene.ressler@gmail.com> - 2012-04-09 05:40 -0700
  Re: combining c-code files into one c-code file Harald Gustafsson <harald.gustafsson@gmail.com> - 2012-04-18 02:01 -0700

csiph-web