home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.amiga.programmer
- Path: chang.unx.sas.com!walker
- From: walker@chang.unx.sas.com (Doug Walker)
- Subject: Re: pointer conversion error
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <DovMqo.27n@unx.sas.com>
- Date: Tue, 26 Mar 1996 13:27:59 GMT
- X-Nntp-Posting-Host: chang.unx.sas.com
- References: <381.6657T11T967@mistral.co.uk> <Pine.A32.3.91.960324124636.16067A-100000@red.weeg.uiowa.edu> <19960325.7D4A7F8.6B80@mojaveg.ridgecrest.ca.us>
- Organization: SAS Institute Inc.
-
- In article <19960325.7D4A7F8.6B80@mojaveg.ridgecrest.ca.us>,
- 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?
- >
-
- That wouldn't explain the problem. Neither would the %u instead of %lu.
- (although the observation is correct and will make a difference if the
- program is compiled with short ints).
-
- There is not enough information here to say why this warning is produced. I'd
- check to make sure some header file isn't #defining printf first, then I'd check
- to make sure that the warning isn't being produced due to a previous line of
- code that doesn't have a semicolon. If you still can't figure it out, post a
- COMPILABLE example that only uses system #include files.
-
- --
- *****
- *|_o_o|\\ Doug Walker walker@unx.sas.com
- *|. o.| ||
- | o |// Any opinions are mine, not those of SAS Institute, Inc.
- ======
-