Advantage of pimpl *other* than compiler firewall?

  • Permalink
  • submit to reddit
  • Email
  • Follow


Apart from implementing compiler firewalls, what significant
advantages are there to using the pimpl idiom?

Why I ask: I'm currently studying some code that uses pimpl
extensively, but which happens to be organized in a way that it
obviates any possible compiler firewall advantages.  Specifically, the
"visible class" and "pimpl class" (to use the terminology in Herb
Sutter's "Exceptional C++) are declared in the same header file.  A
typical header file looks something like this:

// File C.h

class CImpl
{
public:
   virtual void SetX( int x ) = 0;
   virtual int GetX() = 0;
};

class C
{
public:
   virtual void SetX( int x );
   virtual int GetX();
private:
   auto_ptr<CImpl> pimpl;
};

class CImplDef : public CImpl
{
public:
   virtual void SetX( int x);
   virtual int GetX();
private:
   int m_x;
};

I've left out a few details (eg. constructors/destructor, assignment
operators), but basically this is the general layout for dozens of
header files - abstract base class for the implementation, the class
the client uses, and a specified implementation, all declared in the
same header.

Since CImplDef's privates are visible to anyone using class C (by
virtue of appearing in the same header file), in this case pimpl's
compiler firewall benefit has been voided.  So what *other* advantages
are there to using pimpl?

-Gerry Beauregard

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply g 8/23/2003 8:03:11 AM

See related articles to this posting


Hi,

Gerry Beauregard wrote:
> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?

It is fairly straightforward to implement "swap" algorithm on pimpled 
classes. Atomic swap is one of the building blocks useful in 
exception-aware code.

Related to this is another feature: when you use pimpl polymorphically 
(as in your example), it is possible to switch implementations in 
runtime. See also the "strategy pattern".

Of course, none of these two was necessarily exploited in the code you 
posted, so my answer is about what *can* be done, and not about what 
actually *was* done.

-- 
Maciej Sobczak
http://www.maciejsobczak.com/

Distributed programming lib for C, C++, Python & Tcl:
http://www.maciejsobczak.com/prog/yami/


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Maciej 8/23/2003 2:48:31 PM

Gerry Beauregard wrote:

> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?
> 
> Why I ask: I'm currently studying some code that uses pimpl
> extensively, but which happens to be organized in a way that it
> obviates any possible compiler firewall advantages.  Specifically, the
> "visible class" and "pimpl class" (to use the terminology in Herb
> Sutter's "Exceptional C++) are declared in the same header file.  A
> typical header file looks something like this:
> 
> // File C.h
> 
> class CImpl
> {
> public:
>    virtual void SetX( int x ) = 0;
>    virtual int GetX() = 0;
> };

Hmmm, the 'virtual' makes me question whether this is really a PIMPL and
not an exchangable plugin like e.g. streambuffers.
 
> class C
> {
> public:
>    virtual void SetX( int x );
>    virtual int GetX();
> private:
>    auto_ptr<CImpl> pimpl;
> };

Have you tried compiling this with just a declaration of class CImpl?
auto_ptr<>'s needs it perhaps. Furthermore, it should rather be 
  auto_ptr<CImpl> const pimpl;
which strengthen's my above doubt on the PIMPLness of this construct.

Even worse here, the virtual C::SetX() calls the virtual CImpl::SetX().
WTF?

> class CImplDef : public CImpl
> {
> public:
>    virtual void SetX( int x);
>    virtual int GetX();
> private:
>    int m_x;
> };

This makes no sense. The PIMPL in its One True Form(tm) is just like the
type of an object: it will never change during its lifetime. Therefore no
need for dynamic dispatch via virtual functions.

Furthermore, 

> I've left out a few details (eg. constructors/destructor, assignment
> operators), but basically this is the general layout for dozens of
> header files - abstract base class for the implementation, the class
> the client uses, and a specified implementation, all declared in the
> same header.

Hmmm, you left out the most interesting parts, because those define whether
this really is a PIMPL. Does CImpl perhaps have a clone() method ('named
copy ctor') ? Can't the definition of CImplDef not be moved outside the
header (some people are reluctant to define a class outside a header
"because that's how it's always done") ? Is there perhaps a ctor of class
C that takes a (hopefully auto-) pointer to a CImpl ?

> Since CImplDef's privates are visible to anyone using class C (by
> virtue of appearing in the same header file), in this case pimpl's
> compiler firewall benefit has been voided.  So what *other* advantages
> are there to using pimpl?

I sincerely doubt that this is a PIMPL, as already stated. To me, it rather
seems as if someone applied %PATTERN% because %PATTERN% is cool, but
without understanding what is really going on. Also possible that the
person in question simply did not know the PIMPL pattern and simply
invented this independently and called it 'pimpl' but with a slightly
different intent - after all it IS a pointer to the implementation of C.

If I were you, I'd look at the history of that file in you sourcecode
management system for the author and their comments. Maybe that will shed
some light on the issue.

happy hacking

Uli

-- 
Questions ?
see  C++-FAQ Lite: http://parashift.com/c++-faq-lite/  first !


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Ulrich 8/23/2003 5:46:11 PM

Gerry Beauregard wrote:

> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?
> 
> Why I ask: I'm currently studying some code that uses pimpl
> extensively, but which happens to be organized in a way that it
> obviates any possible compiler firewall advantages.  Specifically, the
> "visible class" and "pimpl class" (to use the terminology in Herb
> Sutter's "Exceptional C++) are declared in the same header file.  A
> typical header file looks something like this:
> 
> // File C.h
> 
> class CImpl
> {
> public:
>    virtual void SetX( int x ) = 0;
>    virtual int GetX() = 0;
> };
> 
> class C
> {
> public:
>    virtual void SetX( int x );
>    virtual int GetX();
> private:
>    auto_ptr<CImpl> pimpl;
> };
> 
> class CImplDef : public CImpl
> {
> public:
>    virtual void SetX( int x);
>    virtual int GetX();
> private:
>    int m_x;
> };
> 
> I've left out a few details (eg. constructors/destructor, assignment
> operators), but basically this is the general layout for dozens of
> header files - abstract base class for the implementation, the class
> the client uses, and a specified implementation, all declared in the
> same header.
> 
> Since CImplDef's privates are visible to anyone using class C (by
> virtue of appearing in the same header file), in this case pimpl's
> compiler firewall benefit has been voided.  So what *other* advantages
> are there to using pimpl?

The example you've shown looks pretty pointless to me. But I wondered 
about the class CImplDef and guess that you did not showed us the whole 
story ;-). Does CImpl declare a virtual function called clone()? If so, 
this might be an body/handle implementation with a polymorph body.

The advantage of such a construct is that the handle behaves like a 
polymorph class without the need to handle with pointers and dynamic 
memory allocation (from the class users point of view). Slicing is 
avoided too.

But in that case the functions of C don't have to be virtual nor have 
CImpl and CImplDef to be declared in the header.

Just a wild guess.

regards
Torsten


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Torsten 8/23/2003 5:47:59 PM

"Gerry Beauregard" <g.beauregard@ieee.org> wrote in message
news:9a7f3df5.0308220747.11b38882@posting.google.com...
> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?

1) having mostly one pointer in your class makes heap-allocations, well,
fewer which speeds up this part of the code
2) swaps get the same benefit

regards

Thorsten Ottosen, Dezide Aps



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Thorsten 8/23/2003 5:59:25 PM

>
> Since CImplDef's privates are visible to anyone using class C (by
> virtue of appearing in the same header file), in this case pimpl's
> compiler firewall benefit has been voided.  So what *other* advantages
> are there to using pimpl?
>

In fact, you loose the main advantage of pimpl by doing it that...

A compromise could be to have the base class in the header but
derived ones in sources files if you want to support multiple
derived classes (that may be defined elsewhere).

For others advantages, you may have the following:

- You may uses reference counting instead of copying the
main object.
- It may be usefull to uses to have another hierarchy of classes
for the implementation if you can have different combination
of main and implementation classes.

But typically, you should uses the pimpl idiom and hide the
implementation. You should try to move the code in CPP
files and if it still compiles leave it there.

In some case, you may be able to only move derived
implementation classes (without doing many changes).


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Philippe 8/23/2003 8:06:52 PM

Many thanks for the excellent responses!

>From a few of the posts, it sounds like I may have left out some
crucial details that might explain why the code is organized as it is.

So here's what the header and cpp files really look like.  (I've
changed the class names, and left out #includes, #pragmas, etc., and
most of the comment blocks, but otherwise this is the real deal).  In
the sources, there are many subclasses of the Node class.   For every
Node class (Node and every class derived from Node), there's only one
implementation.

.......

// File Node.h

 class NodeList;
 class __declspec(novtable) NodeImpl  
 {
 public:
  virtual ~NodeImpl() {}
  virtual bool IsComplete() const = 0;
  virtual void SetComplete(bool flag) = 0;
 };

 class Node  
 {
 public:
  virtual ~Node() {}

  // This method will ensure the correct copy constructor is called
for
  // the derived types.
  virtual Node& Clone() const { return *(new Node(*this)); }

  // Search for the given 'type' and append to the list argument.
  virtual bool FindNodeType(MFNode& list, const type_info& type);

  bool IsComplete();
  void SetComplete(bool flag);
 protected:
  NodeImpl& GetNodeImpl() const;
 private:
  mutable boost::shared_ptr< NodeImpl > m_NodeImpl;
 };

 class NodeImplDef : public NodeImpl  
 {
 public:
  NodeImplDef::NodeImplDef() : m_complete(false) {}
  virtual ~NodeImplDef() {}
  virtual bool IsComplete() const     { return m_complete; }
  virtual void SetComplete(bool flag) { m_complete = flag; }
 protected:
  bool m_complete;
 };

+++++++++++

// File Node.cpp

NodeImpl& Node::GetNodeImpl() const
{
 if (!m_NodeImpl)
  m_NodeImpl.reset(&(factory::NodeFact::Instance().CreateNodeImpl()));
 return *m_NodeImpl;
}

bool Node::IsComplete() { return GetNodeImpl().IsComplete(); }
void Node::SetComplete(bool flag) { GetNodeImpl().SetComplete(flag); }

bool Node::FindNodeType(MFNode& nodeList, const type_info& type)
{
 if (typeid(*this) == type)
 {
  nodeList.AddValue(this);
  return  true;
 } 
 return false; 
}

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply g 8/24/2003 11:42:54 PM

On 24 Aug 2003 19:24:48 -0400, llewelly <llewelly.at@xmission.dot.com> wrote:

 >But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
 >auto_ptr<CImpl>'s destructor's point of instantiation, the
 >destructor will call delete on an incomplete class, which is
 >undefined behavior.

Use a boost::shared_ptr.

Or roll your own; the trick used by boost::shared_ptr is that the
smart-pointer in addition to a pointer to the object holds a pointer
to a destructor function, only declared in the .h file.


      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply alfps 8/25/2003 9:14:17 AM

"llewelly" <llewelly.at@xmission.dot.com> wrote in message
news:8665kouhtp.fsf@Zorthluthik.local.bar...
 > "Philippe Mori" <philippe_mori@hotmail.com> writes:
[snip]
 > > But typically, you should uses the pimpl idiom and hide the
 > > implementation. You should try to move the code in CPP
 > > files and if it still compiles leave it there.
 > [snip]
 >
 > But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
 >     auto_ptr<CImpl>'s destructor's point of instantiation, the
 >     destructor will call delete on an incomplete class, which is
 >     undefined behavior.

there a difference between declaration of a member and its instantiation.
as long as the class in complete at the point of instantation, it's ok.

see also

http://www.boost.org/libs/smart_ptr/smart_ptr.htm#common_requirements

regards

Thorsten Ottosen, Dezide Aps



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Thorsten 8/25/2003 9:14:52 AM

"Thorsten Ottosen" <nesotto@cs.auc.dk> writes:

> "llewelly" <llewelly.at@xmission.dot.com> wrote in message
> news:8665kouhtp.fsf@Zorthluthik.local.bar...
>  > "Philippe Mori" <philippe_mori@hotmail.com> writes:
> [snip]
>  > > But typically, you should uses the pimpl idiom and hide the
>  > > implementation. You should try to move the code in CPP
>  > > files and if it still compiles leave it there.
>  > [snip]
>  >
>  > But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
>  >     auto_ptr<CImpl>'s destructor's point of instantiation, the
>  >     destructor will call delete on an incomplete class, which is
>  >     undefined behavior.
>
> there a difference between declaration of a member and its instantiation.
> as long as the class in complete at the point of instantation, it's
> ok.

I'm aware of this. That's why I said 'If'. My point was, if CImpl gets
    put in another header file, and some TU which instantiates
    auto_ptr<CImpl>'s destructor does not #include CImpl's class
    definition, there will be silent misbehavior. Philippe's
    suggestion opens up that danger where it didn't exist. I've seen
    the compilation firewall idiom implemented with 
    auto_ptr<>, and then seen it undone by combining header files,
    precisely because of time spent tracking down bugs due to
    auto_ptr<>'s silent misbehavior. The resulting headers looked much
    like what the OP posted. Quite possibly, the OP's example *was*
    the compilation firewall idiom, until it was undone to avoid the
    evils of auto_ptr<>. And I did know that:

> http://www.boost.org/libs/smart_ptr/smart_ptr.htm#common_requirements

is often a better way to avoid those problems, though I think in some
    cases scoped_ptr<> is more appropriate.

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply llewelly 8/25/2003 10:30:40 PM

llewelly <llewelly.at@xmission.dot.com> wrote in message news:<8665kouhtp.fsf@Zorthluthik.local.bar>...

> But what about the auto_ptr<CImpl> ? If CImpl is incomplete at
>     auto_ptr<CImpl>'s destructor's point of instantiation, the
>     destructor will call delete on an incomplete class, which is
>     undefined behavior.


You declare a destructor, non-inlined.  Place the destructor in your
..cpp file.  It is then the destructor's job to call destructors on all
data members.  As the destructor is in the .cpp file, it can see the
definition of the pimpl class, and will call the destructor on CImpl.

The benefit of switching to BOOST is that it will give you an error if
you forget to do this.

joshua lehrer
factset research systems
NYSE:FDS

      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply usenet_cpp 8/26/2003 12:40:10 AM

Hi,

One reason why I have recently used pimpl is to benefit from a third party
implementation without adding dependencies to my core libraries. Let me
explain.

We used to have a coordinate transformation class that used a hierarchy of
transformations based on different rubber sheet algorithms. All this classes
reside in a module named A that is used in our product, but that it is also
used by another team, and we release it to them as a third party.

For our new release, we wanted to add a new transformation, but instead of
using a rubber sheet algorithm, we wanted to use a third party
implementation of a coordinate system transformation. We want to make this
implementation available to our customers, but we do not want to have that
dependency in the module that we release to other team because of legal
issues (which I do not know much about).

In order to remove the dependency, we used a pimpl, defining our
transformation class in module A, and a base class for the implementation in
module A. This allow us to create implementations using whatever algorithms
we had and put them in module A, and create a new module B that uses the
third party library and defines a new implementation using it. Now, we can
still use the new implementation in our application, and we can ship module
A with no dependencies in the third party lib.

This architecture has also removed some compile time dependencies, which I
am also happy about.

--
Regards,

Isaac Rodriguez
=======================
Software Engineer - Autodesk


"Gerry Beauregard" <g.beauregard@ieee.org> wrote in message
news:9a7f3df5.0308220747.11b38882@posting.google.com...
> Apart from implementing compiler firewalls, what significant
> advantages are there to using the pimpl idiom?
>
> Why I ask: I'm currently studying some code that uses pimpl
> extensively, but which happens to be organized in a way that it
> obviates any possible compiler firewall advantages.  Specifically, the
> "visible class" and "pimpl class" (to use the terminology in Herb
> Sutter's "Exceptional C++) are declared in the same header file.  A
> typical header file looks something like this:



      [ See http://www.gotw.ca/resources/clcm.htm for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
0
Reply Isaac 8/26/2003 7:06:44 PM
comp.lang.c++.moderated 10660 articles. 9 followers. Post

11 Replies
307 Views

Similar Articles

[PageSpeed] 39


  • Permalink
  • submit to reddit
  • Email
  • Follow


Reply:

Similar Artilces:

Advantages of Compiling?
I have a Matlab GUI that interfaces some hardware through a data acquisition card and displays signals in real-time. Occasionally when running the GUI, the graphics freeze up for few seconds and then come back to life, acting as if another process on the computer is taking over the processor momentarily. Since I need to prevent this, I was wondering if it would be beneficial to compile the GUI into a stand along application? Any tips for moving the GUI to a higher priority on the computer would be great. Thanks. JH ...

Firewall advantages/disadvantages
Hi all, I'm fairly new to network security and have been assigned the task of deciding which firewall setup would best suit the security needs of my company's web application. Here are the options I'm looking at so far: 1.) A hardware based firewall acting as an intermediary between the webserver and the outside world. 2.) A software based firewall installed on the webserver. 3.) An additional machine with a software firewall acting as an intermediary between the webserver and the outside world. Could someone please let me know if I'm on the right track with any of these ...

Advantages of using the Compiler
Hi Everyone, Currently I am in the process of evaluating the use of Compiler. I have a java application which uses some M-files. I was wondering if there are any advantages of using the compiled m-files instead. A search gave me : http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/8b8138cd35575666/c6488eaaa982ba63?q=compile+advantage&rnum=3#c6488eaaa982ba63 and http://groups.google.com/group/comp.soft-sys.matlab/browse_frm/thread/7d5f38b681885d11/c1ade2f2e6959826?q=compile+advantage&rnum=1#c1ade2f2e6959826 In the second link above, the poster gave the following 3 ad...

Matlab Compiler; Speed advantage?
Hello, I'm using the "Matlab Compiler" and I've a short question. Are there any advantages to use a compiled version of the own m-files concerning the speed? Is it reasonable to compile the own matlab-scripts? It is reasonable. But I don't know about the speed - I haven't compared. I usually only compile for my end users who don't want to buy full-blown MATLAB. I always run the m-files, not the executable, because I'm always working on developing them. ...

Firewall advantages/disadvantages #2
Hi all, I'm fairly new to network security and have been assigned the task of deciding which firewall configuration would best suit my company's web application. Could someone please help me by giving the advantages/disadvantages of the options listed below or by letting me know if I'm even on the right track to begin with. Thanks, Larry 1.) A software firewall installed on the webserver. 2.) A hardware firewall acting as an intermediary between the webserver and the outside world. 3.) A software firewall installed on a machine that is not the webserver acting as an intermedi...

Micro-firewall compiled into the kernel
I found an example of some firewall code using the netfilter hooks on the web, the URL is www.geocities.com/victorhugo83/micro_firewall.c. This code is supposed to be compilied into a kernel module. However, I can't get it to compile on my system. When I issue the "cc -c micro_firewall.c" command, I get: In file included from /usr/include/linux/highmem.h:5, from /usr/include/linux/skbuff.h:26, from micro_firewall.c:13 /usr/include/asm/pgalloc.h:6:24 asm/fixmap.h: No such file or directory I am using kernel version 2.4.20-20.7 with the kernel...

Smart-pointer pimpl and compiler-generated destructors.
I'd like to use pimpl to reduce dependencies as follows: // myClass.h #include <memory> class myClass { public: myClass(); private: struct myStruct; std::auto_ptr<struct myStruct> m_pimpl; }; // myClass.cpp #include "myClass.h" struct myClass::myStruct { // ...details }; myClass::myClass() : m_pimpl(std::auto_ptr<myStruct>(new myStruct())) { } This compiles just fine, until I try to use myClass elsewhere. At this point, I get warnings like: "deletion of pointer to incomplete type 'myStruct'; no destructor called" I gues...

gcc 64bit compiler does not offer any speed advantage
I must say i didn't expect this. I just did some measures on FreeBSD 6.2 with gcc 3.4.6 and there is absolutely no significant difference between 32 and 64 bit mode - neither in compilation speed, nor in speed of the compiled result. As a benchmark i took a bootstrap of the SmallEiffel Compiler (which has 38 files with around 100 kloc). The times i got were very reliable. The bootstraping (compile the c files from last eiffel compiler stage, and then use this to regenerated the eiffel compiler and all tools) took 32Bit: 2,58 (wall), 2,57 (user), 0,3 (system) => exe size: 1,757,1...

Does the FPGA Compile Server work take advantage of multiple processors?
I've recently set up a remote compile server to take advantage of a Dell Xeon dual-core PC in my lab. While compilation speed has increased by 300%, it has been noted that only one of the eight processor cores present is being used by the LabVIEW FPGA Compile Server. Is there any way to force the server to take full advantage of the hardware that it runs on? Sincerely,&nbsp;&nbsp; Dima No.The Xilinx tool set that the compile server invokes does not support multiple cores.Message Edited by mdevoe on 07-30-2008 03:37 PM Darn. Well, thank you so much for the prompt response! Have a...

which compiler compiled?
Is there a way I can tell which compiler compiled an executable? I looked at the file with a hex editor and didn't see anything obvious. Lawrence "Lawrence" <just4me@nowhere.com> writes: > Is there a way I can tell which compiler compiled an executable? Yes with some compilers and some executable formats. E.g. on HP-UX for PA-RISC: $ aCC leak.C $ odump -compunit a.out ... 6 0 ANSI C++ leak.C /tmp ctcom options = -inst compiletime -diags 523 -inline_power 1 -longbranch 2 -unique_strings on -cachesize 256 B...

To compile or not to compile
Is there some benefit in compiling the apache source yourself? -- //Points ------------------------------------------------------------ http://underthebed.homeip.net ...

Compiling Compiler
Hi there, I need some advice/opinion of the experts out there regarding compilers. I have sun cc compiler that supports 64 bit environment. Now, I compile ACK using this compiler.This should give a compiler that supports 64bit environment. Since the output files are in Solaris format, I compile the ACK source *once again* using the just compiled ACK compiler so that I get Minix object and binary files. Now my questions is that does this 2nd version of ACK be able to produce true 64bit code? Sanky wrote: > Hi there, > > I need some advice/opinion of the experts out there regarding...

Compiled or not compiled
I need to distinguish between two situations: one when a Matlab function is run from Matlab command window and the other one when it is run in compiled mode. Any ideas how to do this? Thanks Tomy Duby "Tomy Duby" <tomy.duby@agilent.com> wrote in message news:idq8q8$85k$1@fred.mathworks.com... > I need to distinguish between two situations: one when a Matlab function > is run from Matlab command window and the other one when it is run in > compiled mode. > Any ideas how to do this? HELP ISDEPLOYED. -- Steve Lord slord@mathworks.com comp.s...

Compile or not compile?
There's something that sometimes in while it bores me a little bit. How do I know if I need to compile a function/procedure or it will be able to compile "on fly". At the beginning I thought this was related to the paths idl "knew", but this happens for two functions/routines in the same directory. Can someone tell when a function can be runned without be compile? Nuno Oliveira wrote: > There's something that sometimes in while it bores me a little bit. How > do I know if I need to compile a function/procedure or it will be able > to compile &quo...

To compile or not to compile
Is there some benefit in compiling the apache source yourself? -- //Points ------------------------------------------------------------ http://underthebed.homeip.net ...

compiling Qt .... compiling Qt ....compiling Qt.... compiling Qt
I got myself new kernel from kernel.org... make xconfig needs Qt (new system). So I got new Qt source this afternoon. It is still compiling.... Who said MS is bloat has not done this. What does Qt do? Dunno, how about xforms for xconfig? On Thu, 02 Feb 2006 19:18:09 +0000, Jan Panteltje wrote: > Dunno, how about xforms for xconfig? Why not curses based? menuform -- Hilsen/Regards Michael Rasmussen http://keyserver.veridis.com:11371/pks/lookup?op=get&search=0xE3E80917 On a sunny day (Thu, 02 Feb 2006 21:55:33 +0100) it happened Michael Rasmussen <mir@miras.or...

program that compiles in C compiler but not in C++ compiler
Hi, I need a small program that compiles in C compiler but not in C++ compiler. Thx in advans, Karthik Balaguru KBG <karthik.balaguru@lntinfotech.com> wrote: > I need a small program that compiles in C compiler but not in C++ > compiler. No problem, just send $10 to paypal@zevv.nl and I'll do your homework for you. -- :wq ^X^Cy^K^X^C^C^C^C KBG said: > Hi, > > I need a small program that compiles in C compiler but not in C++ > compiler. Can you think of any syntactic differences between C and C++? For example, what about keywords? They are very, very sen...

Writing a compiler compiler
Hello, Firstly, let it be known that I am quite new to the subject of parser generators, and having written only simple parsers for frivoulous grammars by hand have little experience. My objective is thus - to create a parser generator that will eventually generate a parser for a dynamic language. However, my undestanding of different parser types and distinctions between is minimal; but as the web is a good enough resourse please assume my knowledge of those areas. The target for this parser generator would be a language similar to C#, and I have found Jay (a yacc clone to C# and Java). Th...

Compiling with the eclipse compiler
Hey all,I have a weird problem (at least it's weird to me).I have a big project that I need to compile through ant with eclipse'scompiler.In the build.xml my compile target looks like this : <target name="compile" depends="release-settings, init" description="compiles everything from source"> <echo message="Compiling with debug = ${build.debug}"/> <depend srcdir="${src.dir}" destdir="${class.dir}" cache="${dependencies.dir}" closure="true"/> <javac srcdir=...

Meta4... a compiler-compiler
in the csa2 gmail account... description is very interesting. in the Pidgin for Apple II/Merlin/6502 message Rich ...

compiling on different compilers
I am working on a set of functions that involve dynamic memory allocation. I started working with gcc and then moved to Pacific C. The reason was that my only access to gcc was through an ssh connection that I did not have access to all the time, so I got Pacific so I could work on my home windows computer. Then I moved back to gcc, which saved me from some major mistakes. Somehow Pacific C was letting me get away with stuff that was completely wrong. gcc immediately gave me segmentation errors until I got every last thing correct. Is gcc the best for catching mistakes? If not, which on...

which compiler was used to compile?
Is there a slick way to invent a constant in a program that tells you which compiler you used. I distribute both JET and JavaC versions of my code, and it helps to know on any error dump which version they were using. Right now I manually change a static final just before compiling. I thought there ought to be something less error prone. -- Canadian Mind Products, Roedy Green. Coaching, problem solving, economical contract programming. See http://mindprod.com/jgloss/jgloss.html for The Java Glossary. Roedy Green wrote: > Is there a slick way to invent a constant in a program that tell...

Problem to compile with g77 a program which was normally compiled with Absoft compiler
Hello, I get the following error messages when I try to compile a program with g77 somefile.f:(.text+0x93): undefined reference to `for_open' somefile.f:(.text+0xf4): undefined reference to `for_write_seq_fmt' somefile.f:(.text+0x128): undefined reference to `for_write_seq_fmt_xmit' somefile.f:(.text+0x454): undefined reference to `for_read_seq' Could you help me to fix this? I have posted more details about my actions on http://stackoverflow.com/questions/3365742/f77-problem-to-compile-with-g77-a-program-which-was-normally-compiled-with-absof Thank you On 30/07/2010 10:2...

Compiler mystery: Compiles classes that don't compile
Can someone please try and explain how this could even happen. I'm about to start fixing some bugs in a program for a client. They haven't really been that organised and just gave me some source code from somewhere, which may or may not be the version of the source code that was used to compile the version of the app that I am supposed to fix bugs in. Now to the problem. The code doesn't even compile. There's a file Container.java, which is missing heaps of methods (private ones I guess as they are only called from inside Container). I decompiled the actual application and whe...