From: Bernd Petrovitsch <bernd@firmix.at>
To: "Budde, Marco" <budde@telos.de>
Cc: linux-kernel@vger.kernel.org
Subject: RE: kbuild & C++
Date: Wed, 07 Sep 2005 14:58:51 +0200 [thread overview]
Message-ID: <1126097932.24425.86.camel@tara.firmix.at> (raw)
In-Reply-To: <809C13DD6142E74ABE20C65B11A2439809C4C0@www.telos.de>
On Wed, 2005-09-07 at 14:04 +0200, Budde, Marco wrote:
[...]
> > Yes, this is a general problem with integrated c/c++ stuff like
> > Win-Visual C++.
>
> not all Windows users do not know what they are doing :-).
> Speaking for myself: I am programming under Linux and
> Windows (with more than 10 years experience in C and C++)
> and I do know the differences. So please do not call
> people idiots only because the are writing software under
> Windows.
I didn't call anyone an idiot, at most I could have meant just
in-experieced in "C vs C++" things. I just happen to know a lot of
people where above is (sadly enough) correct.
> > People think that they can mix it freely,
>
> They can do.
If they know, what they do, yes.
> > in fact they
> > are using *only* C++ (it just happens that some part of the source is
> > compilable with a C compiler, but since you compile everything with
> the
> > C++ compiler pressing F9, no one sees the difference).
>
> So if I compile a library with gcc and link the code to a g++
> program, the complete program gets compiled with the C++ compiler?
> Interesting :-).
No (and I didn't wrote above either).
And BTW it is quite nice to see the differences between gcc and g++ on
little things like the signedness of enums etc. if you compile identical
C-source with both.
And you have to take care that the linkage is correct. For the largest
part this is already standard and works out of the box. But if the
C-library is self-written, things may be different.
> > We re on linux-kernel@ here, so we don't care *here* for user-space
> > software (only for the interface - i.e. sys-calls).
>
> When you develop a complete product consisting of the embedded
> firmware, the driver, and the user space software, you always have
> to decide, where to put the code. And in such a case it is really
> nice, when you can use the same language in all layers.
ACK.
> > And for embedded usage C++ is unsusable in user-space too since it
> will
> > ex-bloat the whole software if people simply pull-in usual and/or
> common
> > C++ libraries like the STL and use them without knowing how much
> object
> > code they explode with it (if used without thinking).
>
> This applies for all languages. If you do not know, what you are doing,
> you can write really awful code. And I cannot agree, that C++ results to
> larger code.
Not necessarily. But with (badly used) C++ templates (read: using e.g.
STL, I don't know much about the boost lib) things can get much worse
*much* faster then with preprocessor magic.
> > Which is again wrong. You can OO software without OO languages (though
> > you loose some nice features and checking).
>
> If you are an experienced OO programmer, you do not want to use
> languages like plain C, because they result into worse code and
> make life more difficult. If you do not like any kind of abstraction,
There are environments where you don't have choice. E.g. if your
embedded system must boot from 4MB.
> why are you using C instead of pure assembler?
Because C is only a portable assembler? ;-)
Because there are several quite usable libs around which also fit into
embedded systems?
And the abstraction (or better: the level of abstraction) is the point.
Of course it is easier to use e.g. perl where buffer-overflows are not
possible and strings and arrays are handled natively etc. But you have
probably other problems too and less control (und usually knowledge)
what is really going on in the background.
> Can you estimate what such a redesign would cost our customers?
> You would need several years to redesign the concept.
I leave it up to you and your customers to decide and won't interfere
with the decision.
So apparently you're stuck with the C++-patch from .is to the kernel and
get the driver to work with this.
*If* you do this, I would interested on the needed effort and problems
(like missing features etc.), just to get an rough idea what it really
took in at least one project.
Bernd
--
Firmix Software GmbH http://www.firmix.at/
mobil: +43 664 4416156 fax: +43 1 7890849-55
Embedded Linux Development and Services
next prev parent reply other threads:[~2005-09-07 12:59 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-07 12:04 Budde, Marco
2005-09-07 12:58 ` Bernd Petrovitsch [this message]
2005-09-07 13:15 ` Nick Piggin
-- strict thread matches above, loose matches on Subject: below --
2005-09-15 12:35 Budde, Marco
2005-09-18 18:41 ` Sam Ravnborg
[not found] <4JJOt-77X-9@gated-at.bofh.it>
2005-09-07 12:02 ` Bodo Eggert
2005-09-07 10:17 Budde, Marco
2005-09-07 18:52 ` Lee Revell
2005-09-07 9:13 Budde, Marco
2005-09-07 9:57 ` Valdis.Kletnieks
2005-09-07 10:45 ` Esben Nielsen
2005-09-07 10:00 ` Bernd Petrovitsch
2005-09-06 11:23 Budde, Marco
2005-09-06 11:30 ` Bernd Petrovitsch
2005-09-06 21:08 ` Chris Frey
2005-09-07 6:39 ` Bernd Petrovitsch
2005-09-06 11:38 ` linux-os (Dick Johnson)
2005-09-06 21:20 ` Jesper Juhl
2005-09-06 22:20 ` Esben Nielsen
2005-09-06 22:22 ` Randy.Dunlap
2005-09-06 22:32 ` Jesper Juhl
2005-09-07 2:33 ` Valdis.Kletnieks
2005-09-07 9:21 ` Esben Nielsen
2005-09-07 10:11 ` Valdis.Kletnieks
2005-09-07 10:58 ` Esben Nielsen
2005-09-07 11:44 ` Bernd Petrovitsch
2005-09-06 21:41 ` Sam Ravnborg
2005-09-10 12:29 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1126097932.24425.86.camel@tara.firmix.at \
--to=bernd@firmix.at \
--cc=budde@telos.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®