Sunday, April 11, 2010

comp.lang.c - 24 new messages in 8 topics - digest

comp.lang.c
http://groups.google.com/group/comp.lang.c?hl=en

comp.lang.c@googlegroups.com

Today's topics:

* question - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.c/t/4c7d70ccf9ccb9d9?hl=en
* C the complete nonsense - 8 messages, 5 authors
http://groups.google.com/group/comp.lang.c/t/fee08dfa5e4cbaaa?hl=en
* Son of Snarky Tirade: a response to Seebach's new CTCN: part 1 - 2 messages,
2 authors
http://groups.google.com/group/comp.lang.c/t/383e6d5a95dc3f75?hl=en
* small question - 2 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/08850414dcd0b366?hl=en
* C - gets() function implementation help - 5 messages, 5 authors
http://groups.google.com/group/comp.lang.c/t/7bd0bc765a2e9603?hl=en
* dynamic buffer allocation at char buf[1] - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.c/t/969816eb2d0fdbaf?hl=en
* Question about void - 1 messages, 1 author
http://groups.google.com/group/comp.lang.c/t/7cda9a8237a38531?hl=en
* Gary Lee Burnore, databasix, and protecting the public. - 1 messages, 1
author
http://groups.google.com/group/comp.lang.c/t/cd36989f151808b8?hl=en

==============================================================================
TOPIC: question
http://groups.google.com/group/comp.lang.c/t/4c7d70ccf9ccb9d9?hl=en
==============================================================================

== 1 of 2 ==
Date: Sun, Apr 11 2010 10:27 am
From: Sjouke Burry


Abdulmalik Muhammad wrote:
> Hi, my name is Abdulmalik Muhammad Yusuf and my question
> is..................................
> what is array in c programming lang?

An array is a collection of teaching aids for lazy students.

Have a nic day.


== 2 of 2 ==
Date: Sun, Apr 11 2010 11:11 am
From: "Bill Cunningham"

"J de Boyne Pollard" <J.deBoynePollard@Tesco.NET> wrote in message
news:e6eb7ae5-f22c-409d-8fe3-f939726357a8@5g2000yqj.googlegroups.com...

It's like an array in other programming languages, but different.
It's exceptionally not like arrays in the islands of Indonesia. It's
not like a boiled egg; although if it's an array of unsigned char it
is not only guaranteed to be quite filling but helpful when dealing
with boiled eggs, especially if you are exchanging your boiled eggs
with other people by sending them along wires (or, nowadays, magically
through thin air). It's sometimes like the queues at the post office,
but only if you aren't an old fogey that hates modern glitz and you
are happy about using the word "stack" in polite company. It's not
like an array in the C++ programming language, except when it is,
because it's not one of those classy things that can be bought from a
Tupperware catalogue (into which one can of course put boiled eggs).
Sometimes, it only looks like an array, but in fact is only a pretend
array that someone has argued you into receiving, and is sizeably
different from the real thing. And it's always like the piers at
Brighton, except without the railings.

Aw fuck off... If you put that kind of energy into such a stupid
comment, no wonder you flattered me so much by spending lonely hours
googling every comment of mine over the last 10 years. TOO MUCH FREE TIME.
In your little flame bait I nybbled.

You'll know when you've become a C/C++ programmer, because you'll come
back to the above and realize that in fact it made sense.

==============================================================================
TOPIC: C the complete nonsense
http://groups.google.com/group/comp.lang.c/t/fee08dfa5e4cbaaa?hl=en
==============================================================================

== 1 of 8 ==
Date: Sun, Apr 11 2010 10:37 am
From: Keith Thompson


Colonel Harlan Sanders <Harlan@kfc.com> writes:
[...]
> Thanks, but I didn't really expect that a FAQ on DOS EOF markers would
> be related to Whatever the Hell CIS URLs are, so I did not look at the
> rest of that site. From the snarky tone of your reply I suspect now
> that when you say "Frequently Given Answer" that you are in fact
> referring to your website, not a generic "Frequently given answer",
> if so, WHY NOT SAY SO?

For anyone who still cares, the '.' in the URL is explained at

<http://homepage.ntlworld.com./jonathan.deboynepollard/FGA/web-fully-qualified-domain-name.html>

or, for those using broken news software:

http://homepage.ntlworld.com./jonathan.deboynepollard/
FGA/web-fully-qualified-domain-name.html

The "CIS" is an abbreviation for "Common Internet Scheme", a term
defined in RFC 1738, <http://www.ietf.org/rfc/rfc1738.txt>. (That's
easy to miss when reading the web page; the first use of the
abbreviation CIS occurs more than a page after the only occurrence of
the phrse "Common Internet Scheme".) I don't recall hearing the term
CIS or "Common Internet Scheme" before. As it happens, the vast
majority of URLs, including all that start with "http://" or "ftp://",
use the Common Internet Scheme. (The RFC never refers to this as
CIS.)

[...]

> So while I do appreciate the information you provide, it does seem
> that you make giving a URL into a needlessly dramatic and complex
> affair.
> Are you actually trying to be helpful, or looking for an opportunity
> to sneer at people for not knowing how to decipher your references?

Personally, I suspect the latter.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


== 2 of 8 ==
Date: Sun, Apr 11 2010 10:40 am
From: Nick <3-nospam@temporary-address.org.uk>


Seebs <usenet-nospam@seebs.net> writes:

> On 2010-04-08, Nick Keighley <nick_keighley_nospam@hotmail.com> wrote:
>> On 6 Apr, 16:54, ImpalerCore <jadil...@gmail.com> wrote:
>>> On Apr 5, 4:58 pm, jacob navia <ja...@jacob.remcomp.fr> wrote:
>> [naviaisms]
>
>>> This is not the kind of attitude that will lead people to want to use
>>> your container library.
>
>> it seems an odd way to judge software. Do you only buy software from
>> people you like. presumably the success of the open source movement is
>> down entirely to Stallman's wit and charm.
>
> No, but I'd guess that free software would have achieved broader adoption
> sooner if Stallman had more charisma (and, dare I say it, social skills).
>
> I have seen quite a few people argue, persuasively, that the key advantage
> FreeBSD had over NetBSD in market penetration was that Jordan Hubbard was
> a persuasive evangelist.

The whole subject is something that ESR goes on about at great length in
The Cathedral And The Bazaar, IIRC.
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk


== 3 of 8 ==
Date: Sun, Apr 11 2010 10:49 am
From: Nick <3-nospam@temporary-address.org.uk>


Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

(examples from C:TCR)

> [1] For example:
>
> char ch;
> /* snip */
> while(!feof(in)) {
> ch = getc(in);
> if(!feof(in)) putc(ch, out);
> }
>
> or:
>
> while(!feof(fp)) {
> fgets(str, 79, fp);
> printf(str);
> }
>
> or:
>
> char c;
> /* snip */
> do {
> ch = getc(in);
> /* snip */
> if(ch=='\t') {
> /* snip */
> }
> else {
> putc(ch, out);
> /* snip */
> }
> } while(!feof(in));
>
> or:
>
> while(*str) if(!ferror(fp)) fputc(*str++, fp);
>
> or:
>
> while(!feof(fp)) putchar(getc(fp));

Looking at these makes me realise that I don't think I've /ever/ used
feof in my life. Trying to read until there is nothing more works so
well.

Does feof have a real use I've somehow missed (the examples above are
clearly not it - they can all be improved by not using the function).
--
Online waterways route planner | http://canalplan.eu
Plan trips, see photos, check facilities | http://canalplan.org.uk


== 4 of 8 ==
Date: Sun, Apr 11 2010 11:03 am
From: Malcolm McLean


On 11 Apr, 18:49, Nick <3-nos...@temporary-address.org.uk> wrote:
>
> Does feof have a real use I've somehow missed (the examples above are
> clearly not it - they can all be improved by not using the function).
>
You're parsing a file, eg a script file. You check for the "end of
script" token, for the sake of argument the word "END". However if
characters follow the "END" the script has a syntax error, which must
be reported. So chomping whitespace and checking for feof() is a
reasonable thing to do.


== 5 of 8 ==
Date: Sun, Apr 11 2010 11:06 am
From: Willem


Nick wrote:
) Looking at these makes me realise that I don't think I've /ever/ used
) feof in my life. Trying to read until there is nothing more works so
) well.
)
) Does feof have a real use I've somehow missed (the examples above are
) clearly not it - they can all be improved by not using the function).

Well,

Euh...

As far as I know, no. I don't think I ever used it either.

Of course, I assume you *do* use ferror() to check for errors when you
get an EOF on a read. IIRC, the only two reasons you can get EOF is
when you either have an error (ferror()) or end of file (feof()).

I guess for robustness you could check both.

Feel free to correct me if I'm wrong here.


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


== 6 of 8 ==
Date: Sun, Apr 11 2010 11:26 am
From: Ben Bacarisse


Nick <3-nospam@temporary-address.org.uk> writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>
> (examples from C:TCR)
<snip>

> Looking at these makes me realise that I don't think I've /ever/ used
> feof in my life. Trying to read until there is nothing more works so
> well.
>
> Does feof have a real use I've somehow missed (the examples above are
> clearly not it - they can all be improved by not using the function).

I've used it on occasion. The most common case would probably be to
determine why an input loop ended when it can end in many ways. To take
a rather contrived example:

int c;
while ((c = getchar()) != EOF) {
/* process c by adding it to some buffer */
if (match(buffer, search_string))
break;
}
/* what happened? */
if (c == EOF)
return feof(stdin) ? NOT_FOUND : IO_ERROR;
/* process the buffer */

After the loop, c == EOF tells us that something went wrong but that
includes both end-of-file and input errors.

--
Ben.


== 7 of 8 ==
Date: Sun, Apr 11 2010 11:30 am
From: Willem


Malcolm McLean wrote:
) On 11 Apr, 18:49, Nick <3-nos...@temporary-address.org.uk> wrote:
)>
)> Does feof have a real use I've somehow missed (the examples above are
)> clearly not it - they can all be improved by not using the function).
)>
) You're parsing a file, eg a script file. You check for the "end of
) script" token, for the sake of argument the word "END". However if
) characters follow the "END" the script has a syntax error, which must
) be reported. So chomping whitespace and checking for feof() is a
) reasonable thing to do.

You just made the same mistake as Schildt:

After you read 'E' 'N' 'D' from the file, feof() will *not* be true,
even if it were the last three characters in the file.
The *correct* thing to do is to check if the next read returns EOF
or not.


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


== 8 of 8 ==
Date: Sun, Apr 11 2010 11:35 am
From: Willem


Ben Bacarisse wrote:
) I've used it on occasion. The most common case would probably be to
) determine why an input loop ended when it can end in many ways. To take
) a rather contrived example:
)
) int c;
) while ((c = getchar()) != EOF) {
) /* process c by adding it to some buffer */
) if (match(buffer, search_string))
) break;
) }
) /* what happened? */
) if (c == EOF)
) return feof(stdin) ? NOT_FOUND : IO_ERROR;
) /* process the buffer */
)
) After the loop, c == EOF tells us that something went wrong but that
) includes both end-of-file and input errors.

I'd use ferror() for that. But that is a matter of taste.

If you read an EOF, then ferror() == !feof() (I think).

Also, I don't see the need for a contrived example where you sometimes
break out of the loop, if you then check for EOF anyways.

Perhaps you meant to write the following:

if (feof(stdin)) return NOT_FOUND;
if (ferror(stdin)) return IO_ERROR;

Then I could see the reason for your contrived example.


Another contrived example could involve clearerr(), perhaps ?


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

==============================================================================
TOPIC: Son of Snarky Tirade: a response to Seebach's new CTCN: part 1
http://groups.google.com/group/comp.lang.c/t/383e6d5a95dc3f75?hl=en
==============================================================================

== 1 of 2 ==
Date: Sun, Apr 11 2010 10:33 am
From: Seebs


On 2010-04-11, Malcolm McLean <malcolm.mclean5@btinternet.com> wrote:
> Ad hominem is a bit more subtle than it might first appear. The ad
> hominem fallacy is to assert that an argument is wrong or invalid
> because of the person who is making it. However we do this all the
> time. No-one's bothered what some schoolkid says about the deficit
> reduction plan. If some central banker says "this is the only policy
> which will reduce the deficit without substantial economic
> dislocation", everyone sits up and takes notice.

Yes. However, *formally*, this is the ad hominem fallacy.

> "Seebs has no computer science qualifications" is a classic case of
> the ad hominem fallacy that everyone makes, and in fact we have to
> make, because we can't give equal time to everyone who asserts
> something. We have to weight the more worthy speakers.

It would be if this were an issue where it were in any way difficult
for an ordinary practitioner in the field to evaluate the claims made.
Since it's not, and since every practitioner who has looked at the claims
confirms them, the presenter becomes irrelevant.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!


== 2 of 2 ==
Date: Sun, Apr 11 2010 11:34 am
From: Moi


On Sun, 11 Apr 2010 07:35:29 -0700, spinoza1111 wrote:

> On Apr 11, 9:03 pm, Willem <wil...@turtle.stack.nl> wrote:
>> spinoza1111 wrote:
>>
>> ) This is my reply (part 1) to Peter Seebach's new edition of "C: the )
>> Complete Nonsense" athttp://www.seebs.net/c/c_tcn4e.html. Further )
>> parts of my complete reply will be forthcoming.


<snip bad acid trip>

You can't use "void main()"
; main returns float.

> So, mijn Heer, you take good care,

Heer should not be capitalised. Capitalised "Heer" refers to God,
which is probably not your intention when you address Willem.

Willem has previously pointed this out to you, but you seem immune to
constructive critique.
Also, nowadays "mijnheer" is usually spelled as "meneer".

HTH,
AvK

==============================================================================
TOPIC: small question
http://groups.google.com/group/comp.lang.c/t/08850414dcd0b366?hl=en
==============================================================================

== 1 of 2 ==
Date: Sun, Apr 11 2010 11:00 am
From: "Bill Cunningham"


This code snippet makes use of memset so I guess this would be a
standard C question. memset()'s first parameter is void* . But in this code
hints is of type struct addrinfo. So does that qualify hints as a pointer of
sorts?

Bill


== 2 of 2 ==
Date: Sun, Apr 11 2010 11:00 am
From: "Bill Cunningham"


Oops forgot code.

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <netdb.h>
#include <sys/socket.h>

struct addrinfo hints, *servinfo;
int main()
{
int status;
memset(&hints, '\0', sizeof hints);
hints.ai_family = AF_INET;
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
if ((status = getaddrinfo(NULL, "23", &hints, &servinfo)) != 0) {
fprintf(stderr, "usage error...%s\n", gai_strerror(status));
exit(1);
}
return status;
}

==============================================================================
TOPIC: C - gets() function implementation help
http://groups.google.com/group/comp.lang.c/t/7bd0bc765a2e9603?hl=en
==============================================================================

== 1 of 5 ==
Date: Sun, Apr 11 2010 11:14 am
From: Malcolm McLean


On 11 Apr, 18:24, Barry Schwarz <schwa...@dqel.com> wrote:
> On Sun, 11 Apr 2010 17:56:54 -0000, "bartc" <ba...@freeuk.com> wrote:
>
> >How do you know you haven't made mistake before you hit Enter?
>
> The fact that no data has been sent to the processor doesn't mean you
> can't read it on the screen.  One might consider the screen as the
> buffer where the data is held until Enter is pressed.
>
In that case you have two processors, a little one which collects
input from the keyboard, marshalls it into an input line, and updates
the screen, and a big one which accepts the processed line input and
solves protein folding (or whatever), sending the results back to the
little processor which updates the scren.


== 2 of 5 ==
Date: Sun, Apr 11 2010 12:15 pm
From: "bartc"

"Barry Schwarz" <schwarzb@dqel.com> wrote in message
news:g904s5t7j11m616vh9ro8ulfsmpvdrvs7v@4ax.com...
> On Sun, 11 Apr 2010 17:56:54 -0000, "bartc" <bartc@freeuk.com> wrote:
>>"Barry Schwarz" <schwarzb@dqel.com> wrote in message
>>news:cig1s5pmnjp3p7bs78c5h1uq7eol379erm@4ax.com...

>>> That may be how it works on your system but my keyboard sends no
>>> signals to the processor until enter is pressed. I wonder how it
>>> works on the OP's system or if he even knows.
>>
>>It sounds quite difficult to use.
>>
>>How do you know you haven't made mistake before you hit Enter?
>
> The fact that no data has been sent to the processor doesn't mean you
> can't read it on the screen. One might consider the screen as the
> buffer where the data is held until Enter is pressed.

OK, so maybe there's a local processor which reads or scans the keyboard and
updates the display (unless your terminal is so old that it uses random
logic).

In that case, perhaps that can be considered the 'processor'. As far as the
main processor is concerned, it doesn't have a proper interactive device
attached, only something that might sporadically give a line of text.

>>Typing a password with a conventional machine is also difficult but at
>>least
>>you can see how many characters you've typed.
>
> I assume by conventional you mean PC.
>
> Believe it or not, there are real security people who say that
> displaying those cute little asterisks is a bad idea. It allows any
> over-the-shoulder lurker to see how many characters are in your
> password, thus making attempts to hack the password easier.

(Does it? What word am I thinking of at this minute? I'll give you a clue:
it's got 7 letters and not 6 or 8 or 9.

But maybe password input should allow extra, discarded, white space to fix
that.)

--
Bartc

== 3 of 5 ==
Date: Sun, Apr 11 2010 11:30 am
From: Keith Thompson


"bartc" <bartc@freeuk.com> writes:
> "Barry Schwarz" <schwarzb@dqel.com> wrote in message
> news:g904s5t7j11m616vh9ro8ulfsmpvdrvs7v@4ax.com...
[...]
>> Believe it or not, there are real security people who say that
>> displaying those cute little asterisks is a bad idea. It allows any
>> over-the-shoulder lurker to see how many characters are in your
>> password, thus making attempts to hack the password easier.
>
> (Does it? What word am I thinking of at this minute? I'll give you a
> clue: it's got 7 letters and not 6 or 8 or 9.

Any outside knowledge about my password is too much.

> But maybe password input should allow extra, discarded, white space to fix
> that.)

No thanks. What if a password actually contains whitespace?

Incidentally, I once used a system that would echo a dot for each
character of a password, but would echo a space for any spaces that
were actually part of the password.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


== 4 of 5 ==
Date: Sun, Apr 11 2010 11:37 am
From: ram@zedat.fu-berlin.de (Stefan Ram)


Barry Schwarz <schwarzb@dqel.com> writes:
>Believe it or not, there are real security people who say that
>displaying those cute little asterisks is a bad idea. It allows any
>over-the-shoulder lurker to see how many characters are in your
>password, thus making attempts to hack the password easier.

I hate it when the ATM acknowledges keys with beeps,
because this way a bystander can know whether I really
pressed a key or just have made a sham finger movement
to confuse observers.

== 5 of 5 ==
Date: Sun, Apr 11 2010 11:22 am
From: Seebs


On 2010-04-11, Malcolm McLean <malcolm.mclean5@btinternet.com> wrote:
> On 11 Apr, 18:24, Barry Schwarz <schwa...@dqel.com> wrote:
>> On Sun, 11 Apr 2010 17:56:54 -0000, "bartc" <ba...@freeuk.com> wrote:
>>
>> >How do you know you haven't made mistake before you hit Enter?
>>
>> The fact that no data has been sent to the processor doesn't mean you
>> can't read it on the screen.  One might consider the screen as the
>> buffer where the data is held until Enter is pressed.
>>
> In that case you have two processors, a little one which collects
> input from the keyboard, marshalls it into an input line, and updates
> the screen, and a big one which accepts the processed line input and
> solves protein folding (or whatever), sending the results back to the
> little processor which updates the scren.

Right -- but your C code is running on the big processor.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

==============================================================================
TOPIC: dynamic buffer allocation at char buf[1]
http://groups.google.com/group/comp.lang.c/t/969816eb2d0fdbaf?hl=en
==============================================================================

== 1 of 3 ==
Date: Sun, Apr 11 2010 11:15 am
From: Moi


On Sun, 11 Apr 2010 15:33:58 +0100, Ben Bacarisse wrote:

> Willem <willem@turtle.stack.nl> writes:
>
>
> It's probably worth saying that in this specific instance (where the
> buffer elements are characters) one can combine some of the advantages
> of both (single allocation/free and some degree of locality) by doing
> this:
>
> struct buffer *bp = malloc(sizeof *bp + BUF_LENGTH); if (bp) {
> bp->len = BUF_LENGTH;
> bp->buf = (char *)bp + sizeof *bp;
> }
>

Personally I would prefer:
bp->buf = (char *) (bp+1);

or maybe even...
bp->buf = (char*) (&bp[1]);


> Even so, I am not sure I'd bother.

Me neither. I use the struct hack wherever I go.
But that is not allowed here.

AvK


== 2 of 3 ==
Date: Sun, Apr 11 2010 11:19 am
From: Eric Sosman


On 4/11/2010 11:54 AM, Willem wrote:
> Eric Sosman wrote:
> ) On 4/11/2010 9:34 AM, Willem wrote:
> )> - A lot of file formats consist of blocks with a fixed-size header,
> )> followed by a variable-size bit of data
> )
> ) For that last, a struct of any kind is risky. Padding,
> ) you know. (Also byte order and other such representational
> ) issues, but they're not unique to structs.)
>
> I know. That's why a lot of compilers have extensions to force a
> struct to not be padded. Should have been added to the language IMO.

To provide a still-inadequate non-solution for the
benefit of lazy programmers? Great idea: Submit a proposal
to the C1x Committee ...

> Along with multi-character character initializers.
> For example: unsigned long exif_tag = 'EXIF';
>
> Unfortunately, that was never standardized. A pity.

Looks like the meat of another proposal.

(In short: Bah!)

--
Eric Sosman
esosman@ieee-dot-org.invalid


== 3 of 3 ==
Date: Sun, Apr 11 2010 11:24 am
From: Seebs


On 2010-04-11, Eric Sosman <esosman@ieee-dot-org.invalid> wrote:
> On 4/11/2010 11:54 AM, Willem wrote:
>> I know. That's why a lot of compilers have extensions to force a
>> struct to not be padded. Should have been added to the language IMO.

> To provide a still-inadequate non-solution for the
> benefit of lazy programmers? Great idea: Submit a proposal
> to the C1x Committee ...

There are cases where it's useful in code which isn't expected to be
portable to many machines, but yeah.

>> Along with multi-character character initializers.

>>
>> Unfortunately, that was never standardized. A pity.

> Looks like the meat of another proposal.

There's a good reason not to standardize it, too, which is that its
meaning is deeply ambiguous, and whichever answer you pick will surprise
some people and break their code.

-s
--
Copyright 2010, all wrongs reversed. Peter Seebach / usenet-nospam@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!

==============================================================================
TOPIC: Question about void
http://groups.google.com/group/comp.lang.c/t/7cda9a8237a38531?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Apr 11 2010 11:16 am
From: "Alf P. Steinbach"


* James Kanze:
> On Apr 10, 8:18 pm, "Alf P. Steinbach" <al...@start.no> wrote:
>> * James Kanze:
>
>>> On Apr 10, 1:00 am, r...@zedat.fu-berlin.de (Stefan Ram) wrote:
>>>> sandeep <nos...@nospam.com> writes:
>>>>> WHY we cannot have a void variable?
>
>>>> In C, »void« is an incomplete type and, therefore, lacks
>>>> information needed to determine the size of x.
>
>>>> I do not recommend crossposting such a question to both
>>>> comp.lang.c and comp.lang.c++: Because they are separate
>>>> languages, this should be discussed separately. Therefore,
>>>> I did not answer for C++, but only for C above.
>
>>> Except that in this particular case, C and C++ are identical.
>
>> Not at all.
>
>> Look else-thread and you'll find a lot of C-specific
>> discussion, and a lot of C++-specific discussion.
>
> Concerning what you might do with it *if* it were allowed. The
> definition of void, however, is identical in C and in C++, as is
> the requirement that a type be complete when you define a
> variable using it (and the fact that "extern void x;" is also
> illegal, although just declaring a variable doesn't normally
> require a complete type).
>
>>> In general, C++ tries to be compatible with C when it is a
>>> question of only the basic types (or composite types which it
>>> has in common with C). Thus, any differences in the definition
>>> of int in C and in C++ can be considered bugs in the C++
>>> standard.
>
>> 'int'?
>
> The difference has been recognized as a defect in the C++
> standard, and is being addressed.
>
>> Anyway, although your point is irrelevant to the present
>> discussion (see below), it's not the case that C++ fundamental
>> types that have corresponding types in C are equivalent to
>> those C types. In particular the languages differ, as I
>> recall, in allowing/disallowing padding bits and trap
>> representations for fundamental types.
>
> No. It's quite clear that both languages allow padding bits and
> trap representations in everything but char types. (There may
> be a difference with regards to plain char: C definitely allows
> trapping representations in plain char; I don't think C++ does.
> In practice, it's not an issue, since the trapping
> representations can only occur with 1's complement or signed
> magnitude representation, and all of the systems using those
> representations define plain char to unsigned.)
>
>>> And void, of course, is a basic type in C, and thus in C++.
>
>> Consider 'char&' in C++.
>
> That's not a type common to C and C++, so the rules for it are
> obviously not common in both languages.
>
>> This is one thing you can do with 'char' in C++ that
>> you cannot do with it in C.
>
> And you can make char a member of a class, or have a char
> parameter to a template. But how is this relevant to the
> semantics of char: char doesn't have any special characteristics
> in C++, which would make it incompatible with C, for this.
> These are characteristics of references, classes and templates,
> not of char. The type char, in C++, is exactly the same as in
> C, or it is a bug in the C++ standard. (In this case, I think
> that there is a bug, but it's slight, and of no practical
> consequences.)

What on Earth are you talking about?

Sorry but I can't make sense of the above.


Cheers & hth.,

- Alf

==============================================================================
TOPIC: Gary Lee Burnore, databasix, and protecting the public.
http://groups.google.com/group/comp.lang.c/t/cd36989f151808b8?hl=en
==============================================================================

== 1 of 1 ==
Date: Sun, Apr 11 2010 11:21 am
From: " Gregory Hall"


"Aratzio" <a6ahlyv02@sneakemail.com> wrote in message
news:2724s59k6hhioebdl88agc1l28qkqrtth6@4ax.com...
> On Sun, 11 Apr 2010 10:23:02 -0400, in the land of news.groups, "atlas
> bugged" <atlasbuggedbyspam@gmail.com> got double secret probation for
> writing:
>
>>"Rhonda Lea Kirk Fries" <rhondaleakirk@earthling.net> wrote in message
>>news:3llc1e.old.17.1@news.alt.net...
>>> John Bartlett wrote:
>>>>>> Why aren't you posting from your Databasix account?
>>>>>
>>>>> I have 8 or 9 nntp accounts. All of them get exercise--although
>>>>> not much lately, because I have more productive things to
>>>>> do--and that post was Altopia's turn.
>>
>>Oh, sure, do let us know when DBSUX's turn rolls around.
>>
>>>> Nice dodge though all too predictable. Tell us the real reason.
>>>
>>> I think you should not be addressing me--in the newsgroup or anywhere.
>>
>>Every few months, someone trots out this same vapid defense of Burnore.
>>
>>For those of you in AUK (or, that is to say, both of you) equipped to
>>think
>>in terms of analogy, this bit is like:
>>
>>"You say the guy stabbed someone with a knife. But that's false, I've
>>*investigated* this. He shot someone with a gun."
>>
>>"Therefore, the shooter is the *true victim* of a *smear campaign.*"
>>
>>"Don't dignify the false knife theory with a response...or, at least not
>>until I'm easily trolled into it in a few months."
>>
>>The Megan's registry bit is a lame dodge. Megan Kanka had neither lived -
>>nor died - at the time of the offense.
>>
>>"Ex Post Facto" is a legal concept that is honored in the breach these
>>days,
>>but it still survives.
>>
>>No one, not even Burnore, has denied he essentially did what he did.
>
> You know, chuck, I am not a lawyer, but I am pretty sure the lawyer in
> your case engaging the defendants outside of court in debate about the
> case or anything even related to the case, is downright stupid.
>
> In case you were thinking that your anonymity is protected because you
> use Altopia, a subpoena to Altopia for your information would be valid
> since you are a principle in the case. Trying to get general users
> information would get you smacked down pretty hard, but principals in
> the case is a whole different matter.
>
> If you knew Chris you would know that his policy does not include the
> actual parties involved in such a case.
>
> I do hope the Judge does not find out what you did, I doubt it will
> reflect well upon your professionalism.


But, what if a subpoena disclosed the fact that atlas bugged, in this
particular case, is just another of my many socks?

Bwahahhahahahahhahaha. Moron! Go shave your legs - they're disgustingly
stubbly.

--
Gregory Hall


==============================================================================

You received this message because you are subscribed to the Google Groups "comp.lang.c"
group.

To post to this group, visit http://groups.google.com/group/comp.lang.c?hl=en

To unsubscribe from this group, send email to comp.lang.c+unsubscribe@googlegroups.com

To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.c/subscribe?hl=en

To report abuse, send email explaining the problem to abuse@googlegroups.com

==============================================================================
Google Groups: http://groups.google.com/?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate