which tutorial to use?

S

santosh

Richard said:
Garbage.

The result is the same. Both break standards. Both for the same
reasons - they think they know best and feel limited by the standard.

Nonsense. There is no comparison between GNU and Microsoft and the
extent of their non-compliance with standards. And both do *not* do it
for the same reasons.
Another thing : you are not forced to use MS compilers.

Maybe, but your workplace uses them more often than not, and I can't
really imagine myself going up to the CEO and demanding that all MS
installations be replaced with MinGW or Cygwin or whatever.
 
R

Richard

santosh said:
Nonsense. There is no comparison between GNU and Microsoft and the
extent of their non-compliance with standards. And both do *not* do it
for the same reasons.

You seem to know a lot about it. I suggest you do not use MS compilers
then. A lot of people do - very successfully, primarily because they dont
really care if it doesn't run on other platforms.
Maybe, but your workplace uses them more often than not, and I can't

My workplace doesn't use them at all actually.
really imagine myself going up to the CEO and demanding that all MS
installations be replaced with MinGW or Cygwin or whatever.

No. In the real world standards compliant C is nice to have but only
necessary in a very small subset of cases. Clearly if you're generating
OSS for multi platform it might be nice. A lot of people dont care - and
that is their choice. There are a lot of reasons MS did add their own
extensions and not all are there to screw over Santosh. A lot were added
to make developing on MS platforms easier.
 
S

santosh

Richard said:
You seem to know a lot about it.

Just common sense. The GNU project has, on the whole, respected
standards better than Microsoft.
I suggest you do not use MS compilers then.

My personal development is based on POSIX (and under Linux), so I don't.

[ ...] There are a lot of reasons MS
did add their own extensions and not all are there to screw over
Santosh. [ ... ]

Can't you refrain from snide personal barbs?
 
I

Ian Collins

santosh said:
Maybe, but your workplace uses them more often than not, and I can't
really imagine myself going up to the CEO and demanding that all MS
installations be replaced with MinGW or Cygwin or whatever.
I did that in my last job (swap M$ for Solaris and Linux), I made all
the developers happy spending the license budget on better equipment!
 
K

Kenny McCormack

Richard said:
No. In the real world standards compliant C is nice to have but only
necessary in a very small subset of cases. Clearly if you're generating
OSS for multi platform it might be nice. A lot of people dont care - and
that is their choice. There are a lot of reasons MS did add their own
extensions and not all are there to screw over Santosh.

One can certainly hope, though, that many, if not most, of them _were_ put
there for that reason.
A lot were added to make developing on MS platforms easier.

Yes, there is that.
 
R

Richard

santosh said:
Just common sense. The GNU project has, on the whole, respected
standards better than Microsoft.

It is standard or it is not. You know that-
My personal development is based on POSIX (and under Linux), so I
don't.

Fine. Me too. Now. maybe not in the future when MS Platform specifics
make life easier.
[ ...] There are a lot of reasons MS
did add their own extensions and not all are there to screw over
Santosh. [ ... ]

Can't you refrain from snide personal barbs?

What is personal about it? You seem to like making it personal - in
this case your obvious hatred for MS.

Also, I apologise if you thought that was a personal remark. It was
meant more as a humorous quip.

I will observe with interest to see you remind the clique when they get personal
on other posters who break "topicality".
 
S

santosh

Richard said:
santosh said:
Richard wrote:
[ ...] There are a lot of reasons MS
did add their own extensions and not all are there to screw over
Santosh. [ ... ]

Can't you refrain from snide personal barbs?

What is personal about it? You seem to like making it personal - in
this case your obvious hatred for MS.

Er no. I don't hate MS. Just dislike them. The price of their products,
more than anything else, is reason enough.

<snip>
 
R

Richard

santosh said:
Richard said:
santosh said:
Richard wrote:
<snip>

[ ...] There are a lot of reasons MS
did add their own extensions and not all are there to screw over
Santosh. [ ... ]

Can't you refrain from snide personal barbs?

What is personal about it? You seem to like making it personal - in
this case your obvious hatred for MS.

Er no. I don't hate MS. Just dislike them. The price of their products,
more than anything else, is reason enough.

It's a free world. I suspect some programmer in China would hate your
pay rates.
 
K

Keith Thompson

Micah Cowan said:
Until at least Microsoft C and gcc are C99-conforming there seems no point
in trying to write portable, C99-dependent code.

I'm not convinced that's the case (though I avoid doing so, myself).
[...]

It doesn't seem unreasonable, then, when certain _portions_ of
functionality specific to the C99 standard reach high levels of
portability, to take advantage of them. Indeed, when certain
extensions that aren't in any standard are widespread, there's nothing
really wrong with using them, either (though they may be offtopic
here). The standard, contrary to some claims, does not define
portability (otherwise we wouldn't even be having this discussion); it
defines a target for implementors to hit if they wish to be
portable. Other targets can co-exist, and sometimes vendors rebel
against the official standard and collectively implement a de facto
one instead.

It seems to me that // comments were widely portable long before C99,
and that one may generally depend on stdint.h and snprintf (thank
God). Inline is widely implemented, but often with significantly
different semantics from C99 (usually based on C++ semantics, I
think), but one can achieve portability with "static inline".
[...]

That's not unreasonable, but it does have its drawbacks. Most C
compilers implement *some* of C99 (by which I mean features that are
in C99 but not in C90/C95), but they implement different subsets.
Let's assume that they all support // comments as an extension. The
problem is that, to be able to use // comments, you have to put your
compiler into a mode where it doesn't complain about them -- and the
side effect is that it won't complain about any other C99 features
that that compiler happens to support. (Maybe you declared an array
with a size that you *thought* was a constant expression, and the
compiler quietly treated it as a VLA.)

You can choose a subset of C99, but you can't persuade your compiler
to enforce that subset for you, which means you run the risk of
writing code that won't work on another compiler. Unless, of course,
the subset of C99 that you choose happens to be exactly C90 or C95 (or
even a subset of C90).

In practice, it might be worth it. Perhaps the benefits of using //
comments (or whatever your favorite widely-implemented C99-only
feature is) are worth the risk that the compiler will fail to diagnose
something. But it's good to be aware that, until all of C99 is widely
supported, there is potentially a price to be paid for going beyond
C90 or C95.
 
R

Randy Howard

Ioannis Vranos said:



GNU approached C99 conformance *fairly* closely, very quickly indeed. And
then they stopped dead. My own belief (although I don't know for sure) is
that they've decided that the bits that are left unimplemented contradict
what GNU consider to be the right way to do things. For example, gcc has
had VLA support since way before C99 came out - but it doesn't work in
quite the way that C99 specifies, and GNU think that their way is better.
If I'm right, there needs to be a change of heart among GNU developers
before we can ever see a C99-conforming version of gcc.

Or we could admit that C99 is flawed and not worry about it anymore.
 
I

Ioannis Vranos

Randy said:
Or we could admit that C99 is flawed and not worry about it anymore.


I had said my negative opinion about C99 (or it was a draft, I am not
100% sure) before here, and got flamed much. I think C99 caused serious
damage to C, and I think some of it will pass to C++ (long long, various
Unicode types as built in types, and probably others that I don't know yet).

Anyway I think the best way for C1x is to be decisive. Adopt only the
widely-implemented subset of C99 and remove the rest. That's it, only.

Most C compilers will be C1x compliant very soon, C99 will be a thing of
the past, and C will have a future.


The other way is to continue going down.
 
S

santosh

Ioannis said:
I had said my negative opinion about C99 (or it was a draft, I am not
100% sure) before here, and got flamed much. I think C99 caused
serious damage to C, and I think some of it will pass to C++ (long
long, various Unicode types as built in types, and probably others
that I don't know yet).

What's wrong with long long?

And about your other point I assume you are talking about Universal
character names? Well I'd be first to admit that they are ugly, but I
don't see a way out without mandating all implementation to support
Unicode in their basic source character set.
Anyway I think the best way for C1x is to be decisive. Adopt only the
widely-implemented subset of C99 and remove the rest. That's it, only.

And what would you nominate for removal? Bear in mind that gets is yet
to be removed from the standard, as are trigraphs and digraphs.
Most C compilers will be C1x compliant very soon, C99 will be a thing
of the past, and C will have a future.

As I understand, Microsoft's compiler isn't yet C95 conforming, so I
doubt that they would take any efforts over and beyond what they have
already taken for C99 conformance. It seems that as far as Microsoft is
concerned C90 will the "final" to be used where absolutely necessary
(like assembler) for dirty low level programming, applications
programmers being strongly encouraged to use [C++/C#]/.NET.
The other way is to continue going down.

All languages come and go. We haven't yet created a universal language
for any purpose and aren't likely to do so. C experienced a period
of "explosive" growth and has no settled down to middle-age. Frankly I
don't see it once again becoming as popular as it was in the 80s and
90s, despite Jacob's tireless efforts. :)
 
I

Ioannis Vranos

santosh said:
What's wrong with long long?


We don't need it. We have short and int guaranteed to hold at least 16
bit values, and long guaranteed to hold at least 32-bit values.
Implementers can extend those to more bits.

And what would you nominate for removal? Bear in mind that gets is yet
to be removed from the standard, as are trigraphs and digraphs.


As I said, the least widely-supported features to be removed.


Most C compilers will be C1x compliant very soon, C99 will be a thing
of the past, and C will have a future.

As I understand, Microsoft's compiler isn't yet C95 conforming, so I
doubt that they would take any efforts over and beyond what they have
already taken for C99 conformance. It seems that as far as Microsoft is
concerned C90 will the "final" to be used where absolutely necessary
(like assembler) for dirty low level programming, applications
programmers being strongly encouraged to use [C++/C#]/.NET.


Actually they support C95. But I don't care for MS especially.


All languages come and go. We haven't yet created a universal language
for any purpose and aren't likely to do so. C experienced a period
of "explosive" growth and has no settled down to middle-age. Frankly I
don't see it once again becoming as popular as it was in the 80s and
90s, despite Jacob's tireless efforts. :)


OK, as I said either this or it will become history like B, while C++ is
here.
 
I

Ian Collins

Ioannis said:
We don't need it. We have short and int guaranteed to hold at least 16
bit values, and long guaranteed to hold at least 32-bit values.
Implementers can extend those to more bits.
We do, some memory models (LLP64 for instance) require 32 bit long and
64 bit long long.
 
J

jacob navia

Ioannis said:
We don't need it.

Sure.

I am sure that the standards committee will say:

"Look, to hell with all processors that are now 64 bit.
Mr Vranos doesn't need those so we will eliminate long long"


You bet. You can laugh at my efforts, like most of the regulars here.
I do not give a dam about your bullshit, and I will go on, yes.

I think C is a very good language, and it is popular because a simple
language is always better than a bloated one.
 
U

user923005

Sure.

I am sure that the standards committee will say:

"Look, to hell with all processors that are now 64 bit.
Mr Vranos doesn't need those so we will eliminate long long"

On a 64 bit CPU, int serves nicely as long long (if the compiler is
constructed sensibly).

[snip]
 
J

jacob navia

user923005 said:
Sure.

I am sure that the standards committee will say:

"Look, to hell with all processors that are now 64 bit.
Mr Vranos doesn't need those so we will eliminate long long"

On a 64 bit CPU, int serves nicely as long long (if the compiler is
constructed sensibly).

[snip]

NO!!

If the compiler is sensible it will keep int 32 bits, as
gcc and microsoft decided (and with reason!)

The problem is that if you put int to 64 bits you have a BLOAT
of the size of all structures, and your program slows down
because it has to move TWICE as much data that a 32 bit program!

In all 64 bit compilers I know, int is still 32 bits.
 
S

santosh

jacob said:
Sure.

I am sure that the standards committee will say:

"Look, to hell with all processors that are now 64 bit.
Mr Vranos doesn't need those so we will eliminate long long"

Actually the point he makes is a sensible one. We don't need long long
to be a minimum of 64 bits but a minimum of 128 bits. Ideally short
would be 16 bits, int 32 and long 64. However because of various 16 bit
systems and the design decision made by Microsoft we are stuck with
16/32 bit int and 32 bit long.

Another general question. If in the future 128 bit processors become
mainstream, what is C going to do if we still want distinct types for
16, 32, 64 and 128 bit objects? int128_t/uint128_t is out of question,
int_leastNN_t and int_fastNN_t must alias one of the existing types.

C's type naming scheme will really start to fray at that point. :)
You bet. You can laugh at my efforts, like most of the regulars here.
I do not give a dam about your bullshit, and I will go on, yes.

I wasn't laughing at your efforts. Remember, almost all participants of
this group are on your side insofar as their support and appreciation
of C goes, notwithstanding lcc-win.

It's wider world of professional desktop and server software development
that has pretty much abandoned C.
I think C is a very good language, and it is popular because a simple
language is always better than a bloated one.

It's the problem that defines the language more than any inherent
qualities of the language itself. If the problem to solve is
sufficiently complex it's solution, including the language used, is
likely to also be complex.

Can you imagine writing a distributed air traffic control system in
Malcolm's MiniBASIC?

One language isn't suitable for all types of work. And if it's "forced"
to do everthing, it will almost certainly end up becoming very complex
in a "meta" level, even if not in syntax and semantics.

An air traffic control system written in MiniBASIC is likely to be
more "complex" than one written in say Ada or C++.
 
S

santosh

jacob said:
user923005 said:
Ioannis Vranos wrote:
santosh wrote:
What's wrong with long long?
We don't need it.
Sure.

I am sure that the standards committee will say:

"Look, to hell with all processors that are now 64 bit.
Mr Vranos doesn't need those so we will eliminate long long"

On a 64 bit CPU, int serves nicely as long long (if the compiler is
constructed sensibly).

[snip]

NO!!

If the compiler is sensible it will keep int 32 bits, as
gcc and microsoft decided (and with reason!)

The problem is that if you put int to 64 bits you have a BLOAT
of the size of all structures, and your program slows down
because it has to move TWICE as much data that a 32 bit program!

Not if the width of the data bus is increased appropriately.
In all 64 bit compilers I know, int is still 32 bits.

Despite my comment above I agree that int should probably be 32 bits for
now. Few programs actually need 64 bit ints.
 
I

Ioannis Vranos

jacob said:
NO!!

If the compiler is sensible it will keep int 32 bits, as
gcc and microsoft decided (and with reason!)

The problem is that if you put int to 64 bits you have a BLOAT
of the size of all structures, and your program slows down
because it has to move TWICE as much data that a 32 bit program!

In all 64 bit compilers I know, int is still 32 bits.


Then why not provide a 32-bit int and a 64-bit long?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,222
Latest member
patricajohnson51

Latest Threads

Top