[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [XForms] fdesign created c files, invalid conversion
From: |
Jens Thoms Toerring |
Subject: |
Re: [XForms] fdesign created c files, invalid conversion |
Date: |
Fri, 29 Oct 2010 01:31:57 +0200 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi Rouben,
On Thu, Oct 28, 2010 at 06:49:06PM -0400, Rouben Rostamian wrote:
> He Jens, re your message:
> >
> > On Thu, Oct 28, 2010 at 05:03:19PM -0400, Rouben Rostamian wrote:
> > > On Thu, Oct 28, 2010 at 10:52:35PM +0200, Jens Thoms Toerring wrote:
> > > > Unfortunately, not at the moment. I will change fdesign so
> > > > that the cast is automatically added to allow compilation
> > > > with C++ compilers (I took that out quite some time ago,
> > > > not considering that people might use C++ compilers, and
> > > > nobody complained until now;-)
> > >
> > > I don't see why you should change fdesign to accommodate people
> > > who misuse it. Fdesign generates C code which is expected
> > > be compiled with a C compiler. Let those who try to compile
> > > it with C++ or Cobol suffer the consequences.
> >
> > Hmmm, since the documentation claims that XForms also works
> > with C++ people may assume that a C++ compiler can also be
> > used to compile the files generated by fdesign with a C++
> > compiler. And I personnaly feel that it's better to make
> > that rather simple change, actually reverting to the old
> > behaviour, than to frustrate them. And as far as I can see
> > this is all that's needed - things would be different if we
> > now also would have to do memory allocation using new etc.;-)
>
> I was not aware that the documentation says that XForms
> also works with C++.
Well, all that's been said is "The routines can be used both
in C and in C++ programs" which is a bit ambigious concerning
what kind of compiler one has to use with the files generated
by fdesign;-)
> If so, then sure, adding the requisite
> incantations to the xforms and fdesign would be the right thing.
The library itself isn't concerned since it just gets linked
to the C or C++ program and isn't supposed to be compiled
with a C++ compiler, so I wouldn't dream of adding something
like this there. It's all about a few lines in the C output
files of fdesign.
> > Or do you know of any C compiler that would complain about
> > unnecessary casts? That would definitely change the situation!
>
> I don't think that an ordinary C compiler will complain about
> the cast because casting is a legal construct in C.
Of course, it can't throw an error but when it comes to
warnings it's a grey area - in principle a C compiler can
issue warnings about everything ("Inconsistent indentation
detected at line 42" or, as newer versions of gcc now do,
"ignoring return value of ‘scanf’") and still be a standard
compliant compiler. So warnings about useless casts are in
principle a possibility. And since I normally crank up the
warning level rather high I personally would be a bit an-
noyed if code that I have to include would result in too
many warnings. But if there's no compiler in existence that
does this I would think add- ing the cast in the fdesign
generated files is much of an issue and the fix required in
fdesign is trivial;-)
Best regards, Jens
--
\ Jens Thoms Toerring ________ address@hidden
\_______________________________ http://toerring.de
Re: [XForms] fdesign created c files, invalid conversion, Rouben Rostamian, 2010/10/28