To: People who write standards

D

d3x0xr

In the other two Postings...

const - and valid conversions of pointers thereto
a more verbose discussion const and conversions

I discussed the existing standards, and discussed several examples of
the various permutations of the declaration of const....

I have been told by several people that my 'interpretation is wrong
about what const it' and that it does not mean what I mean, then
continue to say that it does not force data to remain the same, becuase
aliasing etc can subvert the whole scheme and render any use of const as
mute.

The point I'd really like to see be made is that const should be an
advisory, a declared statement of intent not to modify data. And one
conversion which should always be safe (and not generate a warning) is
any conversion which gains the const attribute at any level.

I'd like to see people be able to declare

void f ( const char * * dont_modify_my_chars )
{
}
and use

{
char buffer[256];
char * buf2 = buffer;
f(&buf2);
}
 
A

Al Balmer

In the other two Postings...

const - and valid conversions of pointers thereto
a more verbose discussion const and conversions

I discussed the existing standards, and discussed several examples of
the various permutations of the declaration of const....

I saw neither of those postings, since I limit the size of newsgroup
downloads, but judging from the above, you're probably in the wrong
newsgroup. Perhaps you want comp.std.c?
 
C

CBFalconer

Al said:
I saw neither of those postings, since I limit the size of newsgroup
downloads, but judging from the above, you're probably in the wrong
newsgroup. Perhaps you want comp.std.c?

I saw neither, and I don't limit the downloads. I think the OP has
made a mistake or two. Or his ISP has lost touch with the net.
Etc. Usenet is not a reliable medium.
 
A

Al Balmer

I saw neither, and I don't limit the downloads. I think the OP has
made a mistake or two. Or his ISP has lost touch with the net.
Etc. Usenet is not a reliable medium.

I actually download the headers, and they indicated some enormous
number of lines, several times my limit of 200. Looking at the subject
lines, the author, and the shorter post which did come through, it was
easy to decide *not* to instruct the reader to fetch them.
 
C

CBFalconer

Al said:
I actually download the headers, and they indicated some enormous
number of lines, several times my limit of 200. Looking at the subject
lines, the author, and the shorter post which did come through, it was
easy to decide *not* to instruct the reader to fetch them.

Another possibility is that the OP included attachments, and the
result passed through a system that (rightly) deleted articles with
attachments.
 
L

lawrence.jones

d3x0xr said:
And one
conversion which should always be safe (and not generate a warning) is
any conversion which gains the const attribute at any level.

That is simply not correct, it would allow you to inadvertently attempt
to modify a const object. For example:

const char c = 'c';
char *pc;
const char **pcc = &pc;
*pcc = &c;
*pc = 'C';

-Larry Jones

Moms and reason are like oil and water. -- Calvin
 

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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top