Path: utzoo!attcan!uunet!philmtl!philabs!phri!marob!daveh From: daveh@marob.masa.com (Dave Hammond) Newsgroups: comp.lang.c Subject: 'Possibly Incorrect Assignment' warnings from Turbo-C Message-ID: <256D8362.18B@marob.masa.com> Date: 24 Nov 89 18:07:29 GMT Sender: daveh@marob.masa.com Reply-To: daveh@marob.masa.com (Dave Hammond) Organization: ESCC, New York City Lines: 18 In porting a program from Unix to Dos, I get an error from Turbo-C `Possibly incorrect assignment' with code similar to the following: char *p, *func(); if (p = func()) do_something(); Am I fooling myself by ass/u/ming that func() will always be invoked and its return value assigned to p, before p is evaluated ? Should I change all such assignments to include an additional set of parens? if ((p = func())) do_something() -- Dave Hammond daveh@marob.masa.com