| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | My last post about the violation ac |
Hallo, Daniel!
*** Am Donnerstag 18. Juli 1996 um 12:34 schrieb Daniel Lynes an Peter Schuller:
PS>> messing things up, in the loop where the exception occurrs, there
PS>> is a "*state++;". The first time that line is
executed, *state is
DL> You need to turn your compiler warnings on too, or you would have found
DL> this out yourself...here are the warnings my compiler spewed forth from
DL> this:
DL> Error! E1014: Left operand must be an 'lvalue'
If it's a sole "*state++", there is no lvalue to be assigned to.
I don't think this error is correctly thrown.
DL> Error! E1029: Expression must be 'pointer to ...'
I lost the original posting. From my memory of the description I don't
understand this message.
DL> Warning! W302: Expression is only useful for its side effects
This warning is ok.
*state++ is a perfectly legal statement by itself. Of course it is illegal
to reference the pointer afterwards if state does not point to an array,
i.e. if it refers to a "single" variable. The compiler cannot
find out about this between function calls.
AFAIR ANSI/ISO forbids the construction of pointers that would otherwise
contain illegal values. It not only forbids the referencing.
void foo(int *x) {
int z;
/* this is ok, but senseless */
*x++;
/* this is illegal, since x does not contain a "legal" pointer */
z=*x;
}
void bar(void) {
int abc;
foo(&abc);
}
Tschau...Thomas
--- E3-32/1.11-32/2.50+
* Origin: Die TeX-Box +49-6034-930021 V.34 -930022 ISDN 24h (2:244/1130.42)SEEN-BY: 50/99 270/101 620/243 625/100 711/401 409 410 413 430 808 809 934 SEEN-BY: 711/955 712/407 515 624 628 713/888 800/1 @PATH: 244/1130 24/999 888 396/1 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.