home *** CD-ROM | disk | FTP | other *** search
- Path: lou.teclink.net!usenet
- From: rad@teclink.net (rad)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: pointer conversion error
- Date: 29 Mar 1996 04:42:10 GMT
- Organization: TECLink Internet Services: info@TECLink.Net
- Message-ID: <1539.6661T1230T1038@teclink.net>
- References: <19960325.7D4A7F8.6B80@mojaveg.ridgecrest.ca.us>
- NNTP-Posting-Host: tc3_62.teclink.net
- X-Newsreader: THOR 2.2 (Amiga;TCP/IP) *UNREGISTERED*
-
- On 25-Mar-96 15:23:18, Everett M. Greene <mojaveg@mojaveg.ridgecrest.ca.us>
- wrote:
- >In article <Pine.A32.3.91.960324124636.16067A-100000@red.weeg.uiowa.edu>
- > The Amorphous Mass <robinson@blue.weeg.uiowa.edu> writes:
- >> On 24 Mar 1996, Adam Atkinson wrote:
- >>
- >> > my c compiler (SAS/C version 6.56) creates a warning about the following:
- >> >
- >> > printf("%u %u %u \n", i, l, h);
- >> >
- >> > three.c 36 Warning 104: conversion from pointer to const/volatile to
- >> > pointer to non-const/volatile
- >> > What am I doing wrong? i,l and h are unsigned longs.
- >>
- >> That's a very curious error. The problem seems to be that you're passing
- >> longs to printf and telling printf that they're ints. Try using %lu
- >> instead of %u.
-
- >Notice that it's not an error, only a warning. i, l, or h has been
- >defined as const?
-
- I can think of a few things that may cause this error. First you need to
- include stdio.h. Did you include this header? Second did you declare a
- prototype for printf? If so it should be as follows:
-
- int printf (const char*, ...);
-
- I don't enough of the original text to tell if either of these is the case.
-
- ---------------------------------------------------------------------------
- - Richard Deken EMail: (personal) rad@teclink.net -
- - VLSI Design Engineer (AuE) rad@aue.com -
- - Advanced Microelectronics PGP public key available -
- ---------------------------------------------------------------------------
-
-