C scripting (continued)

W

Willem

Ian Collins wrote:
) Ivan A. Kosarev wrote:
)>
)> The point of view is not just that there are programs that use gets(),
)> but that if the function is removed right now, it will result into
)> nothing except there will be yet another point where the Standard
)> doesn't reflect the existing practice, which is a much more serious
)> thing than omitting special support for writing new programs.
)
) Do what? Who's existing practice is to use gets()?

Besides which, if gets() is removed from the standard, it only requires
that a concofming compiler issues a diagnostic when it is used, and after
that it is perfectly allowed to compile on as if gets() still exists.

Or am I wrong ?


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 
K

Keith Thompson

Willem said:
Ian Collins wrote:
) Ivan A. Kosarev wrote:
)>
)> The point of view is not just that there are programs that use gets(),
)> but that if the function is removed right now, it will result into
)> nothing except there will be yet another point where the Standard
)> doesn't reflect the existing practice, which is a much more serious
)> thing than omitting special support for writing new programs.
)
) Do what? Who's existing practice is to use gets()?

Besides which, if gets() is removed from the standard, it only requires
that a concofming compiler issues a diagnostic when it is used, and after
that it is perfectly allowed to compile on as if gets() still exists.

Or am I wrong ?

A conforming implementation would also be required to permit a program
to use the identifier "gets" for its own purposes (unless the new
standard treats that identifier as some kind of special case).
 
K

Kenny McCormack

Falconer is noted for pushing his shtick regardless of what is
being said or who was saying it. Just as you were.

I seriously doubt you have a clue as to what my "shtick" is.

Suffice to say that anyone who thinks me an CBF have anything in common,
has not been paying attention.
 
R

Richard Bos

Willem said:
Ian Collins wrote:
) Ivan A. Kosarev wrote:
)>
)> The point of view is not just that there are programs that use gets(),
)> but that if the function is removed right now, it will result into
)> nothing except there will be yet another point where the Standard
)> doesn't reflect the existing practice, which is a much more serious
)> thing than omitting special support for writing new programs.
)
) Do what? Who's existing practice is to use gets()?

Besides which, if gets() is removed from the standard, it only requires
that a concofming compiler issues a diagnostic when it is used, and after
that it is perfectly allowed to compile on as if gets() still exists.

Or am I wrong ?

Yes; if gets() is removed, a conforming implementation may not declare
gets() in Standard mode. Personally, I don't think that this would be a
problem, and would much prefer to see gets() removed, but I can see good
reasons to do so in stages, as it is already being done now, rather than
immediately and without warning.

Richard
 
L

luserXtrog

The Doctor uses gets()? So _that_ explains all those Cybermen
reinvasions!

Indeed, the metaphor seems apt: what is a buffer overflow, but a rift
in the program's universe? A villain transmatting from the future?!
 
G

Giacomo Catenazzi

jacob said:
At least would eliminate one bug in the language.
(...)

The C library is full of badly specificated functions like gets()
or asctime(). Moreover it fails to specify error conditions. That is
why it needs an important work to be done with it. A start was
done with the Technical Report that Microsoft proposed. Even if
many points in that document can be discussed, it represents a huge
step forward in the specifications of the library.

It proves that the industry *IS* interested in developing better
functions in the C standard library, and is a good start since
all functions have an exhaustive ERROR ANALYSIS.

I think these two quotes show the origin of your misunderstandings:
C has a wider scope than your interest.

Industries don't use C. They use other "standards" (e.g.
memory or speed requirements, user interface, networking,
underlying system, etc., or more specialized standards
like POSIX etc.), which restricts usage, but anyway
no industry has a wide scope as C (but compiler industry,
per definition).

Standard C is a koine', so a "minimal" common language,
enough for different industries to speak each other, but
if you were Shakespeare or a local newspaper, you need more.

Take language book: K&R C Language is short, but complete.
Take other language books: Usually they are a lot longer.
Should all programmers learn about networking programming
(without basic networking) or graphical user interfaces
(without basic design) or portable programs (with no
basics about l10n and i18n)?

Which is the best solution? IMO both, so user can do every
time the "right" choice.


Old C program can be compiled and run on today system.
Maybe these programs uses gets. As example:
A lot of old data are archived. How to retrieve such historical
data? Write a new program or letting to use gets?
Is really less secure in some environments? (hits: control-C
or power-off button could cause more damages than a wrong
inputs on console).

There are a lot of usefull old programs, so discourage
use of gets, but allow us to run old program with new
compilers.


I would like that C standard will split issue into
optional parts:
- higher mathematics (and complex numbers):
doing mathematics on very generic processor, or
with a low quality compiler (in such field) is
wrong. I think nobody does. So moving it in a
optional part, we could have higher standards
- networking (IIRC is it already a target)
- graphical user interface
- historical functions (yes, we could move gets here)
- higher io
- l10n and i18n
- portability (trigraphs, IDN, ...)
- thread and multitasking
- ...

so to have minimal language and one learn only the more
interesting parts. Anyway I expects that most compilers
will implement nearly all the features, but it simplifies
using safely C, and it still allow smaller or strange
machine to have a real C

ciao
cate
 
J

jacob navia

Giacomo said:
Old C program can be compiled and run on today system.
Maybe these programs uses gets. As example:
A lot of old data are archived. How to retrieve such historical
data? Write a new program or letting to use gets?

It is really surprising to me why always those two alternatives are
given

Write a NEW program or continue to use gets.

The only thing that needs to be done is replace
gets() by fgets() and recompile. I do not see it as
"writing a new program" !!!

Yes, you have to supply the size of the buffer. In most cases
this is very easy. And if not, you have a potential crash
there.

And if all else fails, you can write gets() since it is at
the beginner level! It is not really complex to write.
 

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

Similar Threads

C as a scripting language 88
C pipe 1
Fibonacci 0
Function is not worked in C 2
Adding adressing of IPv6 to program 1
HELP:function at c returning (null) 4
Lexical Analysis on C++ 1
Can't solve problems! please Help 0

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top