Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!tuvie!inst182 From: inst182@tuvie (Inst.f.Techn.Informatik) Newsgroups: comp.lang.c++ Subject: broken inline qualifier Keywords: C++ 1.2 Message-ID: <1046@tuvie> Date: 27 Dec 89 17:30:05 GMT Organization: TU Vienna EDP-Center, Vienna, AUSTRIA Lines: 37 As far as I can remember the semantics of an inline function is supposed to be *EXACTLY* the same as if it were not declaread as inline. This, however, seems not to be the case in most C++ 1.2 implementations. I only tried the following program on an Apollo using Domain C++ and an Ultrix Vax with designer C++, but it should reproduce on most other C++ 1.2 compilers (those based on the AT&T version) as well: --------------------------------------------------------------------------- #include struct loop { struct loop *next; }; struct loop loopback = { &loopback } ; /* also try this without inline: */ inline overkill ( struct loop * x) { printf("%ul\n",x); /* this should print the same */ x->next = NULL; printf("%ul\n",x); /* as this, ????? :-) */ } main(){ overkill(loopback.next); } --------------------------------------------------------------------------- Michael K. Gschwind ...!uunet!mcvax!tuvie!vlsivie!gschwind -- | _ | Peter J. Holzer | Think of it | | |_|_) | Technische Universitaet Wien | as evolution | | | | | hp@honey.tuwien.ac.at | in action! | | __/ | ...!uunet!mcsun!tuvie!asupa!honey!hp | Tony Rand |