Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Re: Theodore Adorno, a prophet of data systems design

Reply
Thread Tools

Re: Theodore Adorno, a prophet of data systems design

 
 
pete
Guest
Posts: n/a
 
      01-11-2004
Richard Heathfield wrote:

> Rule 1) Do not invoke undefined behaviour,
> at all, ever, in any of your C code.


That's the key to understanding the difference between code
which invokes undefined behavior and code which has behavior
not defined by the standard.

There really *is* something wrong with code that invokes
undefined behavior. Code which invokes undefined behavior,
can't be part of a correct program,
not if the undefined behavior code is reachable, anyway.

On the other hand, there should be *some* situation
where it's OK to invoke an implementation defined function.

--
pete
 
Reply With Quote
 
 
 
 
Ben Pfaff
Guest
Posts: n/a
 
      01-11-2004
pete <(E-Mail Removed)> writes:

> There really *is* something wrong with code that invokes
> undefined behavior. Code which invokes undefined behavior,
> can't be part of a correct program,
> not if the undefined behavior code is reachable, anyway.


That's far too generalized. I write code that, technically, has
undefined behavior, all the time. I know exactly what I'm doing
and why I'm writing it and why I can't write it reasonably in
another way. Restricting everyone to writing strictly conforming
code all the time would render C useless for many purposes.
--
int main(void){char p[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv wxyz.\
\n",*q="kl BIcNBFr.NKEzjwCIxNJC";int i=sizeof p/2;char *strchr();int putchar(\
);while(*q){i+=strchr(p,*q++)-p;if(i>=(int)sizeof p)i-=sizeof p-1;putchar(p[i]\
);}return 0;}
 
Reply With Quote
 
 
 
 
pete
Guest
Posts: n/a
 
      01-11-2004
Ben Pfaff wrote:
>
> pete <(E-Mail Removed)> writes:
>
> > There really *is* something wrong with code that invokes
> > undefined behavior. Code which invokes undefined behavior,
> > can't be part of a correct program,
> > not if the undefined behavior code is reachable, anyway.

>
> That's far too generalized. I write code that, technically, has
> undefined behavior, all the time. I know exactly what I'm doing
> and why I'm writing it and why I can't write it reasonably in
> another way. Restricting everyone to writing strictly conforming
> code all the time would render C useless for many purposes.


He didn't say "strictly conforming".
What kind of undefined behaviors are you talking about ?

--
pete
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      01-11-2004
[Crosspost to comp.lang.c noted and honoured, but I'm not entirely sure
whether clc wants any part of this thread!]

pete wrote:

> Richard Heathfield wrote:
>
>> Rule 1) Do not invoke undefined behaviour,
>> at all, ever, in any of your C code.

>
> That's the key to understanding the difference between code
> which invokes undefined behavior and code which has behavior
> not defined by the standard.
>
> There really *is* something wrong with code that invokes
> undefined behavior. Code which invokes undefined behavior,
> can't be part of a correct program,
> not if the undefined behavior code is reachable, anyway.


Certainly true.

> On the other hand, there should be *some* situation
> where it's OK to invoke an implementation defined function.


Agreed. At that point, however, you are no longer programming in C, but in
C-plus-extensions, and that's a different game (unless you really mean the
standard C meaning of "implementation-defined", in which case I don't quite
see how it's relevant, since "implementation-defined" and "undefined" are
two very separate ideas).

--
Richard Heathfield : http://www.velocityreviews.com/forums/(E-Mail Removed)
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      01-11-2004
Richard Heathfield wrote:
>
> [Crosspost to comp.lang.c noted and honoured, but I'm not entirely sure
> whether clc wants any part of this thread!]
>
> pete wrote:
>
> > Richard Heathfield wrote:
> >
> >> Rule 1) Do not invoke undefined behaviour,
> >> at all, ever, in any of your C code.

> >
> > That's the key to understanding the difference between code
> > which invokes undefined behavior and code which has behavior
> > not defined by the standard.
> >
> > There really *is* something wrong with code that invokes
> > undefined behavior. Code which invokes undefined behavior,
> > can't be part of a correct program,
> > not if the undefined behavior code is reachable, anyway.

>
> Certainly true.
>
> > On the other hand, there should be *some* situation
> > where it's OK to invoke an implementation defined function.

>
> Agreed. At that point, however, you are no longer programming in C,


I disagree. When your program calls a function,
which has been supplied by a conforming C implementation,
then that call is done according to the rules of C,
on that implementation.
When your code invokes indefined behavior,
then you are no longer programming in C on any implementation.

> but in C-plus-extensions, and that's a different game


I'm definitely not talking about portable code.

> (unless you really mean the standard C meaning of
> "implementation-defined", in which case I don't quite
> see how it's relevant,
> since "implementation-defined" and "undefined" are
> two very separate ideas).


I mean a function supplied by the implementation,
like a clear screen function.

You *do* recall the comp.std.c consensus on the issue
of whether or a not a program which calls an implementation
defined clear screen function, is defined or undefined ?

--
pete
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      01-11-2004
pete wrote:
>
> Richard Heathfield wrote:
> >
> > [Crosspost to comp.lang.c noted and honoured,
> > but I'm not entirely sure
> > whether clc wants any part of this thread!]


Followup set to comp.std.c

> >
> > pete wrote:
> >
> > > Richard Heathfield wrote:
> > >
> > >> Rule 1) Do not invoke undefined behaviour,
> > >> at all, ever, in any of your C code.
> > >
> > > That's the key to understanding the difference between code
> > > which invokes undefined behavior and code which has behavior
> > > not defined by the standard.


It might be better if I said "not covered by the standard"

> > >
> > > There really *is* something wrong with code that invokes
> > > undefined behavior. Code which invokes undefined behavior,
> > > can't be part of a correct program,
> > > not if the undefined behavior code is reachable, anyway.

> >
> > Certainly true.
> >
> > > On the other hand, there should be *some* situation
> > > where it's OK to invoke an implementation defined function.

> >
> > Agreed. At that point, however, you are no longer programming in C,

>
> I disagree. When your program calls a function,
> which has been supplied by a conforming C implementation,
> then that call is done according to the rules of C,
> on that implementation. When your code invokes


> indefined


Should be "undefined". That's a bad typo to make in this thread.

> behavior, then you are no longer programming in C
> on any implementation.
>
> > but in C-plus-extensions, and that's a different game

>
> I'm definitely not talking about portable code.
>
> > (unless you really mean the standard C meaning of
> > "implementation-defined", in which case I don't quite
> > see how it's relevant,
> > since "implementation-defined" and "undefined" are
> > two very separate ideas).

>
> I mean a function supplied by the implementation,
> like a clear screen function.
>
> You *do* recall the comp.std.c consensus on the issue
> of whether or a not a program which calls an implementation


> defined


Since the topic is terminology, to be clearer,
I think I should have said "supplied" instead of "defined".

> clear screen function, is defined or undefined ?


--
pete
 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      01-11-2004
pete wrote:

> Richard Heathfield wrote:
>>
>> [Crosspost to comp.lang.c noted and honoured, but I'm not entirely sure
>> whether clc wants any part of this thread!]
>>
>> pete wrote:
>>
>>
>> > On the other hand, there should be *some* situation
>> > where it's OK to invoke an implementation defined function.

>>
>> Agreed. At that point, however, you are no longer programming in C,

>
> I disagree. When your program calls a function,
> which has been supplied by a conforming C implementation,
> then that call is done according to the rules of C,
> on that implementation.


True enough. All right, badly phrased! The point is that the behaviour
of the program is no longer governed by the C standard.

> When your code invokes indefined behavior,
> then you are no longer programming in C on any implementation.
>
>> but in C-plus-extensions, and that's a different game

>
> I'm definitely not talking about portable code.


That's what I thought.

>> (unless you really mean the standard C meaning of
>> "implementation-defined", in which case I don't quite
>> see how it's relevant,
>> since "implementation-defined" and "undefined" are
>> two very separate ideas).

>
> I mean a function supplied by the implementation,
> like a clear screen function.


So do I.

>
> You *do* recall the comp.std.c consensus on the issue
> of whether or a not a program which calls an implementation
> defined clear screen function, is defined or undefined ?


No. I recall a discussion, but not a consensus. Do you have any kind of
handle on high-success-probability search criteria? A message ID would be
fabulous.

--
Richard Heathfield : (E-Mail Removed)
"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
K&R answers, C books, etc: http://users.powernet.co.uk/eton
 
Reply With Quote
 
Ben Pfaff
Guest
Posts: n/a
 
      01-11-2004
pete <(E-Mail Removed)> writes:

> Ben Pfaff wrote:
>>
>> pete <(E-Mail Removed)> writes:
>>
>> > There really *is* something wrong with code that invokes
>> > undefined behavior. Code which invokes undefined behavior,
>> > can't be part of a correct program,
>> > not if the undefined behavior code is reachable, anyway.

>>
>> That's far too generalized. I write code that, technically, has
>> undefined behavior, all the time. I know exactly what I'm doing
>> and why I'm writing it and why I can't write it reasonably in
>> another way. Restricting everyone to writing strictly conforming
>> code all the time would render C useless for many purposes.

>
> He didn't say "strictly conforming".
> What kind of undefined behaviors are you talking about ?


Such things as using non-standard headers and libraries.
--
"IMO, Perl is an excellent language to break your teeth on"
--Micah Cowan
 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      01-11-2004
On Sun, 11 Jan 2004 07:19:46 GMT, in comp.lang.c , pete
<(E-Mail Removed)> wrote:

>Ben Pfaff wrote:


>> That's far too generalized. I write code that, technically, has
>> undefined behavior, all the time. I know exactly what I'm doing
>> and why I'm writing it and why I can't write it reasonably in
>> another way. Restricting everyone to writing strictly conforming
>> code all the time would render C useless for many purposes.

>
>He didn't say "strictly conforming".
>What kind of undefined behaviors are you talking about ?


I would have thought that Ben was probably talking about anything that
made use of system services, databases, gui features etc.

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
 
Reply With Quote
 
pete
Guest
Posts: n/a
 
      01-12-2004
Richard Heathfield wrote:
>
> pete wrote:


> > You *do* recall the comp.std.c consensus on the issue
> > of whether or a not a program which calls an implementation
> > defined clear screen function, is defined or undefined ?

>
> No. I recall a discussion, but not a consensus.
> Do you have any kind of handle on high-success-probability
> search criteria? A message ID would be fabulous.


After further consideration, I'd rather not:
http://groups.google.com/groups?selm...0bell-labs.com

My apologies to all.

--
pete
 
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
CFP - Journal of Systems Architecture, Embedded Software Design(Elsevier), Special Issue on Hardware/Software Co-Design Juan A. Gomez-Pulido VHDL 0 08-24-2009 02:11 PM
2nd. CFP - Journal of Systems Architecture - Embedded Software Design(Elsevier) - Special Issue on HARDWARE/SOFTWARE CO-DESIGN Juan A. Gomez-Pulido VHDL 0 05-24-2009 03:14 PM
Voip PBX,Private Phone Systems,PBX Telephone Systems, Business Phone Systems broadbandera@gmail.com UK VOIP 9 07-24-2006 03:44 PM
Hercules 3D Prophet Radeon 8500 128MB (pro) original BIOS Przemek S. Computer Information 0 08-17-2004 10:39 PM
Hercules 3d prophet 2 mx voltage graham@preeve.plus.com Computer Support 4 12-20-2003 12:12 PM



Advertisments