home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!mips!darwin.sura.net!jvnc.net!nuscc!solomon.technet.sg!ctan
- From: ctan@solomon.technet.sg (Tan Chee Weei)
- Newsgroups: comp.sys.sun.apps
- Subject: strange C++ 3.0 warnings ?
- Message-ID: <1992Aug13.040319.287@nuscc.nus.sg>
- Date: 13 Aug 92 04:03:19 GMT
- Sender: usenet@nuscc.nus.sg
- Distribution: all
- Organization: National University of Singapore
- Lines: 19
-
-
- The Sun C++ 3.0 beta compiler seems to be issuing some warning messages
- that were not present with +w in 2.1. For example, types in func arguments
- declared in the form "class X *" gets a "dubious tag declaration: struct X"
- warning. As a result, the call of the function gets an
- "argument is incompatible with prototype:arg #n" warning.
- Another strange behaviour of cfront is with constant variables.
- For eg. "const short x = -1" gets translated to a "static short x = 65535"
- and each assignment to x gets replaced with 65535. This may be some
- optimisation by cfront but as a result, an "initializer does not fit:65535"
- warning is issued. This is obvious since short is signed and can't
- store 65535 but the underlying ansi c compiler converts it to a value
- equivalent to -1. It's quite a roundabout way of doing things but the
- resulting warnings, is rather irritating, especially if it is a result
- of things cfront does rather than the user. Does anyone have any explanation
- of these behaviour or any information to add on whether this has been
- fixed ot switches to set? Thanks.
-
- CW
-