Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C or C++ for embedded system plug-in?

Reply
Thread Tools

C or C++ for embedded system plug-in?

 
 
Henryk
Guest
Posts: n/a
 
      01-05-2007

Al Balmer schrieb:

> On 4 Jan 2007 08:56:55 -0800, "Henryk" <(E-Mail Removed)> wrote:
>
> >
> >santosh schrieb:
> >
> >> Henryk wrote:
> >> > We made very good experience with C++ on embedded systems even for time
> >> > critical tasks.
> >> <snip>
> >> > The resulting software is very modular and and code is easy to read. We
> >> > almost never had any of those typical C memory access errors...
> >>
> >> What typical C memory access errors?

> >
> >You know what I mean ... ;o)
> >
> >All those little pitfalls due to messing around with pointers. Using
> >references and proper initialized objects in C++ can avoid most of
> >these errors and saves us from checking pointers again and again for
> >validity when handed around within an application...

>
> Sounds like a poorly designed application.
> >
> >Of course you can mess around with references too but its much harder
> >to do so just by accident.

>
> Maybe that's the difference. I don't write code by accident.


Hmm ... but ... sometimes someone makes an error just by accident. You
know, we are human beings... ;o)

Henryk

 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      01-05-2007
Henryk a écrit :
> Al Balmer schrieb:
>>Maybe that's the difference. I don't write code by accident.

>
>
> Hmm ... but ... sometimes someone makes an error just by accident. You
> know, we are human beings... ;o)
>
> Henryk
>


Look Henryk, we are speaking about human beings, not about
beings like "Al Balmer" that never has an accident, never
make any errors and in general is high above us simple mortals.



 
Reply With Quote
 
 
 
 
jacob navia
Guest
Posts: n/a
 
      01-05-2007
santosh a écrit :
> jacob navia wrote:
>
>>CBFalconer a écrit :
>>
>>>jacob navia wrote:
>>>... snip ...
>>>
>>>
>>>>That's why I inroduced references in lcc-win32 C compiler
>>>
>>>How do you disable them, and ALL the other extensions?
>>>

>>
>>No need to disable them, since you use them only if
>>you explicitely write
>> int &a = b;
>>
>>You just do not use that.

>
>
> But there should be a mode in which the compiler produces a diagnostic
> and possibly halts compilation for sources having non-C90 and/or
> non-C99 constructs.
>
> For lcc-win32 what are the switches or flags which turn on this
> behaviour?
>


Yes. Use the -ansic switch
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      01-05-2007
Henryk wrote:
> CBFalconer schrieb:
> > Henryk wrote:

<snip repeated post>
> > Why did you post this 3 times? Usenet is not an instantaneous
> > medium. Time to propagate ranges from millisecs to infinity.

>
> Sorry about that! My network browser did not respond so I thought it
> was not sent. I deleted the posts later, but maybe this works only in
> the google groups...


Not even there.

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      01-05-2007
jacob navia wrote:
> CBFalconer a écrit :
>> jacob navia wrote:
>>
>> ... snip ...
>>
>>> That's why I inroduced references in lcc-win32 C compiler

>>
>> How do you disable them, and ALL the other extensions?

>
> No need to disable them, since you use them only if
> you explicitely write
> int &a = b;
>
> You just do not use that.


So lcc-win32 fails to detect a syntactic error caused by an easy
typo.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>

 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      01-05-2007
CBFalconer wrote:
> jacob navia wrote:
> > CBFalconer a écrit :
> >> jacob navia wrote:
> >>
> >> ... snip ...
> >>
> >>> That's why I inroduced references in lcc-win32 C compiler
> >>
> >> How do you disable them, and ALL the other extensions?

> >
> > No need to disable them, since you use them only if
> > you explicitely write
> > int &a = b;
> >
> > You just do not use that.

>
> So lcc-win32 fails to detect a syntactic error caused by an easy typo.


It isn't a typo in the lcc-win32 language. To coerce the compiler to
compile C90, apparently, you've to supply the -ansic switch.

I would test it if I had Windows. wedit refuses to run under Wine.

 
Reply With Quote
 
CBFalconer
Guest
Posts: n/a
 
      01-05-2007
santosh wrote:
> CBFalconer wrote:
>> jacob navia wrote:
>>> CBFalconer a écrit :
>>>> jacob navia wrote:
>>>>
>>>> ... snip ...
>>>>
>>>>> That's why I inroduced references in lcc-win32 C compiler
>>>>
>>>> How do you disable them, and ALL the other extensions?


^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^
>>>
>>> No need to disable them, since you use them only if
>>> you explicitely write
>>> int &a = b;
>>>
>>> You just do not use that.

>>
>> So lcc-win32 fails to detect a syntactic error caused by an easy typo.

>
> It isn't a typo in the lcc-win32 language. To coerce the compiler to
> compile C90, apparently, you've to supply the -ansic switch.
>
> I would test it if I had Windows. wedit refuses to run under Wine.


Or on W98 executing on a 486. Contrary to Jacobs claim of W98
compatibility. Please read the underlined query I made originally.

--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>


 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      01-06-2007
On Fri, 05 Jan 2007 11:56:42 +0100, in comp.lang.c , jacob navia
<(E-Mail Removed)> wrote:

>Henryk a écrit :
>> Al Balmer schrieb:
>>>Maybe that's the difference. I don't write code by accident.

>>
>>
>> Hmm ... but ... sometimes someone makes an error just by accident. You
>> know, we are human beings... ;o)
>>
>> Henryk
>>

>
>Look Henryk, we are speaking about human beings, not about
>beings like "Al Balmer" that never has an accident, never
>make any errors and in general is high above us simple mortals.


Ignoring the ad hominem rudeness, the point Al was making is that the
error in question isn't one you can accidentally make very easily,
unless you're writing C++ by accident.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
Reply With Quote
 
Randy Howard
Guest
Posts: n/a
 
      01-10-2007
On Fri, 5 Jan 2007 02:38:05 -0600, Richard Heathfield wrote
(in article <(E-Mail Removed)>):

> CBFalconer said:
>
>> jacob navia wrote:
>>>

>> ... snip ...
>>>
>>> That's why I inroduced references in lcc-win32 C compiler

>>
>> How do you disable them, and ALL the other extensions?

>
> One surefire method would be to use gcc (avec incantations).


Works for me.


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





 
Reply With Quote
 
Randy Howard
Guest
Posts: n/a
 
      01-10-2007
On Fri, 5 Jan 2007 04:57:31 -0600, jacob navia wrote
(in article <459e2f18$0$5092$(E-Mail Removed)>):

> santosh a écrit :
>> jacob navia wrote:
>>
>>> CBFalconer a écrit :
>>>
>>>> jacob navia wrote:
>>>> ... snip ...
>>>>
>>>>
>>>>> That's why I inroduced references in lcc-win32 C compiler
>>>>
>>>> How do you disable them, and ALL the other extensions?
>>>>
>>>
>>> No need to disable them, since you use them only if
>>> you explicitely write
>>> int &a = b;
>>>
>>> You just do not use that.

>>
>>
>> But there should be a mode in which the compiler produces a diagnostic
>> and possibly halts compilation for sources having non-C90 and/or
>> non-C99 constructs.
>>
>> For lcc-win32 what are the switches or flags which turn on this
>> behaviour?
>>

>
> Yes. Use the -ansic switch


Which generates C89? Is there something for ISO standard C?



--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded <divs> with events: How to prevent the parent div's eventfrom being fired when the embedded div's event is fired? Num GG Javascript 2 11-17-2008 08:56 PM
Embedded vs. Non-embedded Tests Trans Ruby 11 09-05-2007 11:22 AM
Embedded languages based on early Ada (from "Re: Preferred OS, processor family for running embedded Ada?") Colin Paul Gloster VHDL 48 04-10-2007 10:31 AM
How to display images embedded in e-mail as embedded, not attachments Jim Firefox 4 12-11-2004 05:36 AM
Databind an embedded control in an embedded datagrid Thomas Dodds ASP .Net Datagrid Control 0 07-26-2004 08:20 PM



Advertisments