[vorbis] Use of const

Tim Waugh twaugh at redhat.com
Wed Jan 3 06:40:27 PST 2001


On Wed, Jan 03, 2001 at 03:26:25PM +0100, Olaf van der Spek wrote:

> For example, this compiles fine (on VC++ 6), but itsn't right:

Then it is a bug in VC++ 6.  GCC does the right thing even without -W
or -Wall.

[twaugh at meme /tmp]$ gcc -c c.c
c.c: In function `fn1':
c.c:8: warning: passing arg 1 of `fn2' discards qualifiers from pointer target type
[twaugh at meme /tmp]$ cat c.c
int fn2 (char *s)
{
        return 0;
}

int fn1 (const char *s)
{
        return fn2 (s);
}

Using const in the right places _is_ a good idea.

Tim.
*/


<HR NOSHADE>
<UL>
<LI>application/pgp-signature attachment: stored
</UL>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: part
Type: application/octet-stream
Size: 233 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/vorbis/attachments/20010103/c0d4f73e/part-0001.obj


More information about the Vorbis mailing list