Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utcsrgv.UUCP Path: utzoo!utcsrgv!dave From: dave@utcsrgv.UUCP (Dave Sherman) Newsgroups: net.lang.c Subject: Is this legal C? Message-ID: <2783@utcsrgv.UUCP> Date: Mon, 21-Nov-83 15:02:56 EST Article-I.D.: utcsrgv.2783 Posted: Mon Nov 21 15:02:56 1983 Date-Received: Mon, 21-Nov-83 15:48:47 EST Organization: The Law Society of Upper Canada, Toronto Lines: 17 I recently had occasion to use a construct which is a little strange, and I was wondering whether it's guaranteed to be portable. if(0) retry: printf("Try again.\n"); printf("What's two plus two? "); .... /* if get a bad answer */ goto retry; This code ensures that the "Try again" message isn't executed the first time through. It works fine on the VAX (4.1bsd) and PDP-11 (v7). Can I be sure that the "goto" to a statement within a condition will work with any C compiler? Dave Sherman -- {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave