Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!srhqla!demott!kdq From: kdq@demott.COM (Kevin D. Quitt) Newsgroups: comp.os.msdos.programmer Subject: Re: TC++ 1.0 Loses Type Information? (In English) Keywords: Turbo-C Message-ID: <640@demott.COM> Date: 2 Oct 90 18:18:27 GMT References: <2019@cpgvgw.vid.cpg.sony.co.jp> Reply-To: kdq@demott.COM (Kevin D. Quitt) Organization: DeMott Electronics Co., Van Nuys CA Lines: 36 In article <2019@cpgvgw.vid.cpg.sony.co.jp> kutner@vid.cpg.sony.co.jp (Mike Kutner) writes: >The following code fragment gives a "Suspicious pointer conversion" >warning message when compiled by Turbo C++ 1.0 (in C mode). It seems >that the structure member's type information is getting lost. An >explicit cast (enum day_t *) gets rid of the warning message. However, >am I being dense or has someone else seen this problem? > >enum day_t {mon, tue, wed, thu}; > >struct date_t >{ > enum day_t day; >}; > >void foo(enum day_t *dtp) >{ > *dtp = tue; >} > >void main(void) >{ > struct date_t bar; ^^^^^^_________________Shouldn't this be enum? > > foo(&(bar.day)); /* <--- Suspicious pointer conversion */ >} > -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last 96.37% of all statistics are made up.