473,804 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why is it dangerous?

'evening.

I'm not new to C and have been programming in it since I was 8 but
here's a strange problem I've never seen before.

When I compile a program from our C course with a windows compiler
there is no problem but when I try to compile it with a linux compiler
it complains that

a_03.c:(.text+0 x4d): warning: the `gets' function is dangerous
and should not be used.

Is linux more dangerous than windows? Where can I download a
non dangerous gets function? I have never used gets before is
there undefined behavior somewhere?
Here is a trimmed down example program from my assignment that
demonstrates the problem

#include <stdio.h>
#include <malloc.h>

void main()
{
char *string;
printf("enter string (max 2000 chars): ");
fflush(stdin);
fflush(stdout);
string = (char *)malloc(2001);
if(!string) exit(1);
gets(string);
printf("you entered: %s\n", string);
free(string);
exit(0);
}

On windows with TurboC and Lcc no error is printed. On linux with
gcc it says gets is dangerous.

Please advise my instructor says gcc is overly pedantic.
Aug 10 '08
233 8725
Richard Heathfield wrote:
ja*********@ver izon.net said:
Richard Heathfield wrote:
[OT]
....
I accept that "American" is a correct description of citizens of the USA -
just as it is a correct description of Canadians, Colombians, Cubans, and
Chileans. Nevertheless, a more localised adjective is useful (just as it
is for Canadians, Colombians, Cubans, and Chileans). If "Usanian" is
offensive for some bizarre reason, fine, someone coin another word. (I did
Most of them see no reason to coin another word, because they see no
fault with the one they are currently using. The fact that you
disagree wouldn't matter to them.

....
They would be just as insulted as a
British citizen might be at being called an Englishman,

I can't see how that would be an insult.
if he wasn't actually English

Ah, that would do it. :-) But I don't see the parallel. I use the term
"Usanian" only to apply to those who are citizens of the USA. Those who
are not citizens of the USA have no grounds for being offended by the
term, since I'm not applying it to them. (And those who are, have no
grounds either, since there's nothing remotely offensive about it.)
There is an exact parallel: in both cases they would be objecting to
being called by a name that they considered to be incorrect. Whether
or not you agree that the name is incorrect, its perceived
incorrectness is precisely the reason they would consider it
offensive.
There is a difference, of course - many British citizens would object
to being call English for reasons in addition to it being an incorrect
term, based upon their own personal feelings about the English.
Obviously, that wouldn't be an issue with Usanian, because the average
US citizen has never even heard the term, and therefore has no
negative associations to connect with it.

I'm going to try to describe the views of a large diverse group of
people that I don't agree with. I'm going to simplify the description
by pretending that they can be characterized by a single point of
view. With that in mind, I think that point of view would be that
"America" and "American" are a noun and an adjective that each
uniquely refer to the United States of America, except when they occur
in combination with either "North" or "South", in which case the
combined phrase refers to a continent. "The Americas" is a noun phrase
refers to both continents; there is no adjective that refers to both
continents, and little need for one.

If I expected English to be a logical language, I might find that
confusing. Since it obviously isn't, I don't. While your point of view
might be more logical, in US dialects of English those terms are in
use with essentially the meanings listed above, far more often than
the word "Usanian", and that's likely to remain true indefinitely. All
I can say about the difference between those meanings and yours are
that you're speaking a different but closely related language from the
one that they are speaking, and that I'm fluent in both languages.
Aug 14 '08 #121
Default User wrote:
Keith Thompson wrote:
....
Better yet, consider that you appear to be the only person who holds
this particular opinion

One of two, it would now seem, on this newsgroup.
If you're referring to me, keep in mind that I don't share your point
of view, I merely expressed an understanding of it. In particular, I
do not believe that objections to the use of "America" as a synonym
for "USA" stem solely from malicious intent (though I am sure that
many people who do have malicious intent do in fact object to that
usage).
Aug 14 '08 #122
ja*********@ver izon.net said:
Richard Heathfield wrote:
>ja*********@ver izon.net said:
Richard Heathfield wrote:
[OT]
...
>I accept that "American" is a correct description of citizens of the USA
- just as it is a correct description of Canadians, Colombians, Cubans,
and Chileans. Nevertheless, a more localised adjective is useful (just
as it is for Canadians, Colombians, Cubans, and Chileans). If "Usanian"
is offensive for some bizarre reason, fine, someone coin another word.
(I did

Most of them see no reason to coin another word, because they see no
fault with the one they are currently using. The fact that you
disagree wouldn't matter to them.
Understood. Nevertheless, to co-opt a term that describes the population of
a whole continent - nay, *two* whole continents - and apply it only to an
admittedly large minority of that population is self-aggrandising, and it
should not surprise us to learn that those who seek self-aggrandisement
are not going to be best pleased by the introduction of a term which
neutralises it.
They would be just as insulted as a
British citizen might be at being called an Englishman,

I can't see how that would be an insult.
if he wasn't actually English

Ah, that would do it. :-) But I don't see the parallel. I use the term
"Usanian" only to apply to those who are citizens of the USA. Those who
are not citizens of the USA have no grounds for being offended by the
term, since I'm not applying it to them. (And those who are, have no
grounds either, since there's nothing remotely offensive about it.)

There is an exact parallel: in both cases they would be objecting to
being called by a name that they considered to be incorrect.
That's quite a weak parallel. A stronger parallel would be that of the
English (or, if you prefer, the British) deciding that the term "European"
should apply uniquely to them, and considering as incorrect the idea that
"European" might apply to others. (My own view is rather different, in
that I don't consider the UK to be part of Europe - but that's merely a
symptom of a self-consciously parochial affectation, adopted for its
amusement value, and in any case it's by the by.)

If the British were to co-opt the term "European", accepting it only as a
self-description, the French, German, Italian, Spanish and other European
populations would be (rightly) scathing.
Whether
or not you agree that the name is incorrect, its perceived
incorrectness is precisely the reason they would consider it
offensive.
It has long been my experience that people are rarely offended by
incorrectness. Otherwise, they would speak more carefully, write more
carefully, drive more carefully, think more carefully, and possibly even
vote more carefully.
There is a difference, of course - many British citizens would object
to being call English for reasons in addition to it being an incorrect
term, based upon their own personal feelings about the English.
Obviously, that wouldn't be an issue with Usanian, because the average
US citizen has never even heard the term, and therefore has no
negative associations to connect with it.
Right. Let's take a parallel term that I've seen noised around the place -
"Ukian" - I've never seen a formal definition, but it seems reasonable to
assume that it is intended to describe the people of the United Kingdom of
Great Britain and Northern Ireland.

I consider "Ukian" to be an ugly word, and I don't use it myself. But I'm
not *offended* by it. That would be ludicrous.

<snip>
All
I can say about the difference between those meanings and yours are
that you're speaking a different but closely related language from the
one that they are speaking, and that I'm fluent in both languages.
Ah, I'm afraid my multilingual skills pale in comparison to yours. :-)

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Aug 14 '08 #123
ja*********@ver izon.net wrote:
Default User wrote:
Keith Thompson wrote:
...
Better yet, consider that you appear to be the only person who
holds this particular opinion
One of two, it would now seem, on this newsgroup.

If you're referring to me, keep in mind that I don't share your point
of view, I merely expressed an understanding of it.
Fair enough. I'll stand alone then.

Brian
Aug 14 '08 #124
Richard Heathfield wrote:
ja*********@ver izon.net said:
>Richard Heathfield wrote:
>>ja*********@ver izon.net said:

Richard Heathfield wrote:
[OT]
...
>>I accept that "American" is a correct description of citizens of the USA
- just as it is a correct description of Canadians, Colombians, Cubans,
and Chileans. Nevertheless, a more localised adjective is useful (just
as it is for Canadians, Colombians, Cubans, and Chileans). If "Usanian"
is offensive for some bizarre reason, fine, someone coin another word.
(I did
Most of them see no reason to coin another word, because they see no
fault with the one they are currently using. The fact that you
disagree wouldn't matter to them.

Understood. Nevertheless, to co-opt a term that describes the population of
a whole continent - nay, *two* whole continents - and apply it only to an
admittedly large minority of that population is self-aggrandising, and it
should not surprise us to learn that those who seek self-aggrandisement
are not going to be best pleased by the introduction of a term which
neutralises it.
>>>They would be just as insulted as a
British citizen might be at being called an Englishman,
I can't see how that would be an insult.

if he wasn't actually English
Ah, that would do it. :-) But I don't see the parallel. I use the term
"Usanian" only to apply to those who are citizens of the USA. Those who
are not citizens of the USA have no grounds for being offended by the
term, since I'm not applying it to them. (And those who are, have no
grounds either, since there's nothing remotely offensive about it.)
There is an exact parallel: in both cases they would be objecting to
being called by a name that they considered to be incorrect.

That's quite a weak parallel. A stronger parallel would be that of the
English (or, if you prefer, the British) deciding that the term "European"
should apply uniquely to them, and considering as incorrect the idea that
"European" might apply to others. (My own view is rather different, in
that I don't consider the UK to be part of Europe - but that's merely a
symptom of a self-consciously parochial affectation, adopted for its
amusement value, and in any case it's by the by.)

If the British were to co-opt the term "European", accepting it only as a
self-description, the French, German, Italian, Spanish and other European
populations would be (rightly) scathing.
>Whether
or not you agree that the name is incorrect, its perceived
incorrectnes s is precisely the reason they would consider it
offensive.

It has long been my experience that people are rarely offended by
incorrectness. Otherwise, they would speak more carefully, write more
carefully, drive more carefully, think more carefully, and possibly even
vote more carefully.
>There is a difference, of course - many British citizens would object
to being call English for reasons in addition to it being an incorrect
term, based upon their own personal feelings about the English.
Obviously, that wouldn't be an issue with Usanian, because the average
US citizen has never even heard the term, and therefore has no
negative associations to connect with it.

Right. Let's take a parallel term that I've seen noised around the place -
"Ukian" - I've never seen a formal definition, but it seems reasonable to
assume that it is intended to describe the people of the United Kingdom of
Great Britain and Northern Ireland.

I consider "Ukian" to be an ugly word, and I don't use it myself. But I'm
not *offended* by it. That would be ludicrous.

<snip>
>All
I can say about the difference between those meanings and yours are
that you're speaking a different but closely related language from the
one that they are speaking, and that I'm fluent in both languages.

Ah, I'm afraid my multilingual skills pale in comparison to yours. :-)
I think you have it completely wrong friend Richard. Over here in the
New World we identify with our nationality, not geography. No one over
here thinks of themselves in continental terms, North or South American,
rather in terms of our nationality. Canadian, Mexican, Brazilian,
Argentinian. And American because our nation is United States of America.

'American' is not a correct description of Canadians or Chileans.

--
Joe Wright
"Everything should be made as simple as possible, but not simpler."
--- Albert Einstein ---
Aug 15 '08 #125
Joe Wright said:

<snip>
I think you have it completely wrong friend Richard.
Well, that's certainly a point of view. :-)
Over here in the
New World we identify with our nationality, not geography.
Sure. "America" is a geographical term. Your nation is named not "America"
but "United States of America", right?
No one over
here thinks of themselves in continental terms, North or South American,
rather in terms of our nationality.
Then may I suggest that you start describing yourselves with a national
term, rather than a continental one? Just an idea. :-)
Canadian, Mexican, Brazilian,
Argentinian. And American because our nation is United States of America.
Canada -Canadian
Mexico -Mexican
Brazil -Brazilian
Argentina -Argentinian
United States of America -United States of American (for which "Usanian"
is a convenient contraction).

The pattern seems clear to me.
'American' is not a correct description of Canadians or Chileans.
If not, then neither is it a correct description of citizens of the USA.

Just remind me how many angels it was? :-)

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Aug 15 '08 #126
In article <5O************ *********@bt.co m>, rj*@see.sig.inv alid wrote:
>
What offensive usage? What's offensive about the word? I don't understand
that at all.
Fine - given that you live in the U.K., we'll refer to you henceforth as a Ukian.

Aug 15 '08 #127
In article <AI************ *************** ***@bt.com>, rj*@see.sig.inv alid wrote:
>Understood. Nevertheless, to co-opt a term that describes the population of
a whole continent - nay, *two* whole continents - and apply it only to an
admittedly large minority of that population is self-aggrandising, and it
should not surprise us to learn that those who seek self-aggrandisement
are not going to be best pleased by the introduction of a term which
neutralises it.
You don't honestly believe that citizens of Canada, Mexico, or Brazil think of
themselves as "Americans" , do you?
Aug 15 '08 #128
In article <6g************ @mid.individual .net>, "Default User" <de***********@ yahoo.comwrote:
>Keith Thompson wrote:
>At the very least, please consider the possibility that people who use
the term are not being deliberately offensive.

I don't actually believe that. I believe it to be dig (minor and more
with sniggering humor than real malice) at Americans to use that term.
I don't for a minute believe that users of the term are bleeding their
hearts for the Costa Ricans and such shut out by the use of the term to
mean only those from the USA.
Moreover, once one has been informed that the use of a particular word,
phrase, etc. causes offense, to continue to use that word, phrase, etc. *is*
being deliberately offensive.
Aug 15 '08 #129
Doug Miller said:
In article <5O************ *********@bt.co m>, rj*@see.sig.inv alid wrote:
>>
What offensive usage? What's offensive about the word? I don't understand
that at all.

Fine - given that you live in the U.K., we'll refer to you henceforth as
a Ukian.
Yes, I'm aware of the term. I don't particularly like it (any more than I
like, say, runner beans or pilchards), but neither am I offended by it.

--
Richard Heathfield <http://www.cpax.org.uk >
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Aug 15 '08 #130

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

101
3397
by: Bill Cunningham | last post by:
I read an article in a book about Perl and Common Gateway Interface and it mentioned C. It said that C could damage your computer. I don't know wether it meant the standard or compiler issuses. I was a little upset. Well more upset. I sent Dennis Ritchie and email. I don't know if he'll respond if he gets it. Sometimes he does sometimes not. How can C damage your computer? Bill
1
2842
by: b83503104 | last post by:
When are they not consistent?
4
1302
by: cesark | last post by:
Hi ! I have important doubts about how to handle the security in asp.net vb.net web forms. Somebody can help me? 1. If you have setting ‘validateRequest=true’ in .net framework1.1, What can do you do to improve the security? Because although you have validations on server side you can enter dangerous characters in a text field, with the exception of telephone numbers or similar.
302
18625
by: Lee | last post by:
Hi Whenever I use the gets() function, the gnu c compiler gives a warning that it is dangerous to use gets(). Is this due to the possibility of array overflow? Is it correct that the program flow can be altered by giving some specific calculated inputs to gets()? How could anyone do so once the executable binary have been generated? I have heard many of the security problems and other bugs are due to array overflows.
6
7469
by: Brendan | last post by:
Hi, I'm trying to mimic the IPC/messaging system of an specific OS in a portable way by using GCC's library. The IPC system uses buffered asynchronous messages, where any thread can send a message to any other thread (i.e. to the "threadID") without blocking, and the receiver does any security checks necessary. I'm trying to implement the portable/linux version on top of sockets/datagrams ("SOCK_DGRAM" in the local namespace), and so...
10
9370
by: lovecreatesbea... | last post by:
C stops the conversion from (char **) to (const char **). c-faq.com sec 11.10 has explanation on this point. But, for example, even the conversion from (char *) to (const char *) brings the same dangerous as in the previous conversion. Why the latter simple but dangerous one is allowed in C? $ cat f1.c int main(void) { const char c = 'a';
6
3580
by: Thomas.li | last post by:
Hi, I want to convert CString to LPBYTE like LPBYTE lpByte = (BYTE*)(LPCTSTR)cstring; is it very dangerous to do that?
0
10595
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5529
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4306
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.