Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > some well known stupidness in c99

Reply
Thread Tools

some well known stupidness in c99

 
 
Ben Bacarisse
Guest
Posts: n/a
 
      11-20-2012
Ian Collins <(E-Mail Removed)> writes:

> On 11/21/12 10:14, Keith Thompson wrote:

<snip>
>> We don't have the luxury of redefining the language and breaking
>> existing code, but if we did, I'd suggest the following (among many
>> other things):
>>
>> 1. Change the "const" keyword to "readonly".
>>
>> 2. Add a "constant" keyword, allowing you to define things like:
>>
>> constant int x = 42;
>>
>> constant int y = 1.0/3.0; /* not exactly representable,
>> but still constant */
>>
>> constant char ESC = '\x1b';

>
> Or just adopt the C++ rules and avoid breaking any valid existing
> code!


There are valid C program that would break under C++'s rules. Maybe
these are not mainstream uses of const, but one of the troubles with
such changes is there is no reliable mechanism for the language
committee to find out what the impact of a change would be.

--
Ben.
 
Reply With Quote
 
 
 
 
glen herrmannsfeldt
Guest
Posts: n/a
 
      11-20-2012
James Kuyper <(E-Mail Removed)> wrote:
> On 11/20/2012 04:14 PM, glen herrmannsfeldt wrote:


>> Note that Fortran allows one to specify either a numeric or
>> string value on the STOP statement. That hasn't stopped implementations
>> on systems that didn't support string status values.

>
> Yes, and the Fortran specifies what it does with that string: it
> displays it, rather than attempting to pass it as an exit status.


Well, that is a popular implementation, but the standard is pretty
loose on the requirement. It does sound like an implementation on
a system that allowed for string exit status would return that value.

Also, implementations that don't allow for integer exit status
should print that, but again it isn't required.

VM/CMS prints any non-zero exit status from a program, but doesn't
do anything special for zero.

> I've repeatedly asked fir to specify what he wanted done with the string
> after it was returned, with no response. If he had said "print it to
> stderr", that would be perfectly reasonable; but if so, he still needs
> to specify what exit status should be returned, since he's hijacked what
> used to be the only way of specifying that status.


It seems that Fortran exit codes for PAUSE and STOP go back to Fortran I
where the octal code is displayed on the address field of the storage
register (that is, lights on the front panel).

Now that most don't have a panel with lights and switches, it has
to go somewhere else.

-- glen
 
Reply With Quote
 
 
 
 
fir
Guest
Posts: n/a
 
      11-20-2012
W dniu wtorek, 20 listopada 2012 23:07:04 UTC+1 użytkownik Ian Collinsnapisał:
> On 11/21/12 11:01, James Kuyper wrote:
>
> > On 11/20/2012 04:57 PM, Keith Thompson wrote:

>
> > ...

>
> >> Given that C already has perfectly good mechanisms for printing

>
> >> messages to stderr, there's no point at all in changing the

>
> >> definitions of main() and exit() to do the same thing.

>
> >>

>
> >> There's nothing wrong with having a convenience function that prints

>
> >> a message and terminates the program, but there's no need to define

>
> >> such a function in the language.

>
> >

>
> > I was just trying to get fir to be more specific about what he was

>
> > proposing. I agree with you that if this is what he was proposing

>
> > (something he's never bothered clarifying, despite repeated requests),

>
> > it's not really necessary - in fact, I've already pointed out to him the

>
> > ease with which he could define such a function himself.

>
>
>
> Well what else to you expect form a troll? Have a look at his previous
> threads here.
>


I consider all people using their fav word 'troll' should go to some low level school
times yet again
do not involve me with that, its to much stupid. shame on you trol-trol-troll slightly tragic ppl, do not involve me with that (I am
saying that though I know it iis
endless, but do not matter)


 
Reply With Quote
 
Greg Martin
Guest
Posts: n/a
 
      11-20-2012
On 12-11-20 02:46 PM, fir wrote:
> W dniu wtorek, 20 listopada 2012 23:07:04 UTC+1 użytkownik Ian Collins napisał:
>> On 11/21/12 11:01, James Kuyper wrote:
>>
>>> On 11/20/2012 04:57 PM, Keith Thompson wrote:

>>
>>> ...

>>
>>>> Given that C already has perfectly good mechanisms for printing

>>
>>>> messages to stderr, there's no point at all in changing the

>>
>>>> definitions of main() and exit() to do the same thing.

>>
>>>>

>>
>>>> There's nothing wrong with having a convenience function that prints

>>
>>>> a message and terminates the program, but there's no need to define

>>
>>>> such a function in the language.

>>
>>>

>>
>>> I was just trying to get fir to be more specific about what he was

>>
>>> proposing. I agree with you that if this is what he was proposing

>>
>>> (something he's never bothered clarifying, despite repeated requests),

>>
>>> it's not really necessary - in fact, I've already pointed out to him the

>>
>>> ease with which he could define such a function himself.

>>
>>
>>
>> Well what else to you expect form a troll? Have a look at his previous
>> threads here.
>>

>
> I consider all people using their fav word 'troll' should go to some low level school
> times yet again
> do not involve me with that, its to much stupid. shame on you trol-trol-troll slightly tragic ppl, do not involve me with that (I am
> saying that though I know it iis
> endless, but do not matter)
>
>


If it seems endless perhaps you should reconsider some of your ideas.
They seem far fetched and poorly enough thought out to appear to be the
efforts of a troll. Inductive reasoning - if it walks like a duck and
quacks like a duck ... maybe you could change your tune?

 
Reply With Quote
 
fir
Guest
Posts: n/a
 
      11-20-2012
W dniu wtorek, 20 listopada 2012 23:01:23 UTC+1 użytkownik James Kuyper napisał:
> On 11/20/2012 04:57 PM, Keith Thompson wrote:
>
> ...
>
> > Given that C already has perfectly good mechanisms for printing
> > messages to stderr, there's no point at all in changing the
> > definitions of main() and exit() to do the same thing.
> >
> > There's nothing wrong with having a convenience function that prints
> > a message and terminates the program, but there's no need to define
> > such a function in the language.

>
>
>
> I was just trying to get fir to be more specific about what he was
> proposing. I agree with you that if this is what he was proposing
> (something he's never bothered clarifying, despite repeated requests),
> it's not really necessary - in fact, I've already pointed out to him the
> ease with which he could define such a function himself.


Sorry for that, it is not intended, just
there is many texts here and i do not have
time to carefully try to answer to everything
this time.

(Also this cutting and editing stuff is
bothersome here in google groups (should find
better working newsgate)

If you want to get answer to something please write an exact question and Iwill answer to
that (couse I am little lost in not to much
exact questions maybe (If not I can get back
to some topics later, I am much interested in
c topics and can discuss it for years)





 
Reply With Quote
 
fir
Guest
Posts: n/a
 
      11-20-2012
W dniu wtorek, 20 listopada 2012 23:56:19 UTC+1 użytkownik Greg Martinnapisał:
> On 12-11-20 02:46 PM, fir wrote:
>
> > W dniu wtorek, 20 listopada 2012 23:07:04 UTC+1 użytkownik Ian Collins napisał:

>
> >> On 11/21/12 11:01, James Kuyper wrote:

>
> >>

>
> >>> On 11/20/2012 04:57 PM, Keith Thompson wrote:

>
> >>

>
> >>> ...

>
> >>

>
> >>>> Given that C already has perfectly good mechanisms for printing

>
> >>

>
> >>>> messages to stderr, there's no point at all in changing the

>
> >>

>
> >>>> definitions of main() and exit() to do the same thing.

>
> >>

>
> >>>>

>
> >>

>
> >>>> There's nothing wrong with having a convenience function that prints

>
> >>

>
> >>>> a message and terminates the program, but there's no need to define

>
> >>

>
> >>>> such a function in the language.

>
> >>

>
> >>>

>
> >>

>
> >>> I was just trying to get fir to be more specific about what he was

>
> >>

>
> >>> proposing. I agree with you that if this is what he was proposing

>
> >>

>
> >>> (something he's never bothered clarifying, despite repeated requests),

>
> >>

>
> >>> it's not really necessary - in fact, I've already pointed out to him the

>
> >>

>
> >>> ease with which he could define such a function himself.

>
> >>

>
> >>

>
> >>

>
> >> Well what else to you expect form a troll? Have a look at his previous

>
> >> threads here.

>
> >>

>
> >

>
> > I consider all people using their fav word 'troll' should go to some low level school

>
> > times yet again

>
> > do not involve me with that, its to much stupid. shame on you trol-trol-troll slightly tragic ppl, do not involve me with that (I am

>
> > saying that though I know it iis

>
> > endless, but do not matter)

>
> >

>
> >

>
>
>
> If it seems endless perhaps you should reconsider some of your ideas.
> They seem far fetched and poorly enough thought out to appear to be the
> efforts of a troll. Inductive reasoning - if it walks like a duck and
> quacks like a duck ... maybe you could change your tune?


whats is wrong with which concept (c improvement) exactly?



 
Reply With Quote
 
James Kuyper
Guest
Posts: n/a
 
      11-20-2012
On 11/20/2012 05:32 PM, Ben Bacarisse wrote:
> Ian Collins <(E-Mail Removed)> writes:

....
>> Or just adopt the C++ rules and avoid breaking any valid existing
>> code!

>
> There are valid C program that would break under C++'s rules.


Example, please? I believe that the change we're talking about would
simply involve adding "an lvalue of integer type that refers to a
non-volatile const object initialized with a constant expression" to
6.6p6, and to add "an lvalue that refers to a non-volatile const object
initialized with a constant expression" to 6.6p7. There's probably a
better way to organize it so that there's no so much duplicated
description between the two additions.

As far as I can see, the sole effect of such a change would be to give
standard-defined behavior to code constructs that were previously
constraint violations.
 
Reply With Quote
 
Greg Martin
Guest
Posts: n/a
 
      11-20-2012
On 12-11-20 03:10 PM, fir wrote:
> W dniu wtorek, 20 listopada 2012 23:56:19 UTC+1 użytkownik Greg Martin napisał:
>> On 12-11-20 02:46 PM, fir wrote:
>>


>>
>>
>>
>> If it seems endless perhaps you should reconsider some of your ideas.
>> They seem far fetched and poorly enough thought out to appear to be the
>> efforts of a troll. Inductive reasoning - if it walks like a duck and
>> quacks like a duck ... maybe you could change your tune?

>
> whats is wrong with which concept (c improvement) exactly?
>
>
>


Read the responses already given to your suggestions.
 
Reply With Quote
 
fir
Guest
Posts: n/a
 
      11-20-2012
W dniu wtorek, 20 listopada 2012 22:14:22 UTC+1 użytkownik Keith Thompson napisał:
> fir <(E-Mail Removed)> writes:
>
>


> 1. Change the "const" keyword to "readonly".
>
> 2. Add a "constant" keyword, allowing you to define things like:
>
> constant int x = 42;
>


constant int x = 50;

seem quite ok for me, As to readonly it do
not look such good for me (maybe something like 'immutable' attribute to set on and off for variables would be better - though I
never yet considered usability of this
immutability personally
 
Reply With Quote
 
fir
Guest
Posts: n/a
 
      11-21-2012
W dniu środa, 21 listopada 2012 00:26:16 UTC+1 użytkownik Greg Martin napisał:
> On 12-11-20 03:10 PM, fir wrote:
>
>
> > whats is wrong with which concept (c improvement) exactly?

>
>
> Read the responses already given to your suggestions.



If you would find there any statements that would show me that my sugesstions (ideas/
concepts/propositions/improvements) are
logically/conceptually wrong I would very
much like to see it and talk about it

I can see no one.

For example as to

char* main(char* arg)
{
return "hallo world";
}

(or close to that couse there can be unresolved details here)

some people just said that no oses are
ready for that - but it is not important
here becousa I am talking about 'technical goodness' here - what would be good (not
about what will work on some oses) And it
would be good it would have many fine uses

(it is also not a matter of 'exit codes'
or 'exit status' as someona called that, it
is a mattaer of 'return value' from program
- this value can be used in many ways pottentialy it could be a whole 'robinson
crusoe' string or chunk of bytes, could
go thru ram buffer (not file buffer)
back to the system work fast and could
be fun, it is good idea (i was happy to get
on it some months back)
 
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
Re: Is this phase-accumulator trick well-known??? Mike Treseler VHDL 0 02-08-2009 07:17 PM
List mutation method gotcha - How well known? Hendrik van Rooyen Python 20 03-16-2008 09:55 AM
Difference between "library parts" of C99 and "language parts" of C99 albert.neu@gmail.com C Programming 3 03-31-2007 08:14 PM
C99 struct initialization (C99/gcc) jilerner@yahoo.com C Programming 3 02-20-2006 04:41 AM
well-known Internet sites which use Java based web servers Mladen Adamovic Java 3 10-24-2005 09:48 PM



Advertisments