From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,976f7334973592b2 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2001-07-13 12:00:12 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsxfer.eecs.umich.edu!hardy.tc.umn.edu!news.nodak.edu!not-for-mail From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Newsgroups: comp.unix.tru64 Subject: Re: question about particular ptrmismatch warning Date: 13 Jul 2001 18:58:46 GMT Organization: North Dakota Higher Education Computing Network (NDHECN) Message-ID: <9ingd6$vdt$1@news.ndsu.nodak.edu> References: <9il0pr$6b8$1@news.ndsu.nodak.edu> <1yG37.698$rc5.47673@news.cpqcorp.net> NNTP-Posting-Host: dogbert.cc.ndsu.nodak.edu Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: news.ndsu.nodak.edu 995050726 32189 134.129.106.23 (13 Jul 2001 18:58:46 GMT) X-Complaints-To: abuse@nodak.edu NNTP-Posting-Date: 13 Jul 2001 18:58:46 GMT X-Newsreader: trn 4.0-test74 (May 26, 2000) Originator: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Xref: archiver1.google.com comp.unix.tru64:3494 In article <1yG37.698$rc5.47673@news.cpqcorp.net>, wrote: > "Tim Mooney" wrote in message > news:9il0pr$6b8$1@news.ndsu.nodak.edu... > > > > cc -DHAVE_CONFIG_H -I. -I. -I. -std1 -O2 -g3 -tune host -arch > host -portable > > -readonly_strings -msg_disable inlinestoclsmod,valuepres -c ltdl.c -DPIC > > > > *why* does the compiler generate an Info message regarding the assignment > > above (and subsequent Warning messages about ptrmismatch when func is > > used later): > > > The compiler emits the message because you specified -portable on the > command line. This tells the compiler to emit diagnositics for > constructs that may not be accepted by other compilers. Because this > cast violates the C standard, other compilers may not accept it. Thanks. I did understand the what `-portable' was about, I was more interested in why this wasn't considered portable, i.e. exactly why it violates the standard. > The standard only permits casts between pointers to object or incomplete > types and other pointers to object or incomplete types, or between > pointers to function types. One can not cast a pointer to void (an > incomplete type) to a pointer to a function type (as you are doing). I > don't want to guess why the standard does not allow this. Maybe you > could ask in comp.lang.c. :-) I thought about that, but I would definitely be showing my ignorance in that group. It might be covered in the FAQ, though, so I'll take a look. > Note that if you would like more information on any compiler message, > add the -verbose switch to the command line. This will cause additional > information to be output for each message. > > Hope this helps, It does, thanks. Tim -- Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J6, IACC Building (701) 231-8541 (Fax) North Dakota State University, Fargo, ND 58105-5164