Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: const * question Message-ID: <31165@sun.uucp> Date: Sun, 18-Oct-87 00:29:32 EDT Article-I.D.: sun.31165 Posted: Sun Oct 18 00:29:32 1987 Date-Received: Sun, 18-Oct-87 22:38:42 EDT References: <1151@lznv.ATT.COM> Sender: news@sun.uucp Lines: 13 Keywords: const pointer > Have I missed an important point? Have the compiler writers confused > return conversion semantics with assignment return semantics in this > case? Which needs the fix: my code, or their compiler? Neither, technically; you are trying to get the language to let you do something reasonable, and the rules of the language - which are being correctly interpreted by the compiler - won't let you. In effect, you want a polymorphous function that takes a "const char *" argument and returns a "const char *" value, and takes a "char *" argument and returns a "char *" value; however, C doesn't support polymorphism. Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com