| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | My last post about the violation ac |
Hallo, Mario!
*** Am Donnerstag 25. Juli 1996 um 09:51 schrieb Mario Semo an Thomas Seeling:
TS>> void foo(int *x) {
TS>> *x++;
TS>> z=*x;
MS> ??? whats illegal with z=*x;? x is a int *, *x is a int, ....
But x does not contain a valid pointer. As soon as x is incremented, it
(kind of) points to the successor of (*x), but that location is not defined
as a valid variable in the source.
TS>> void bar(void) {
TS>> int abc;
(*x) from above could point to (&abc)-1, (&abc)+1 or even something
completely different, as you invoke undefined behaviour (here "1"
means sizeof(int)).
TS>> foo(&abc);
MS> even with this the above is ok.
No, it is not. You may not reference pointers which contain illegal values.
Even more rigid, you must not construct such pointers if you want to stay
Ansi/Iso conformant.
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™.