home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6305 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.1 KB  |  50 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: chang.unx.sas.com!walker
  3. From: walker@chang.unx.sas.com (Doug Walker)
  4. Subject: Re: pointer conversion error
  5. Sender: news@unx.sas.com (Noter of Newsworthy Events)
  6. Message-ID: <DovMqo.27n@unx.sas.com>
  7. Date: Tue, 26 Mar 1996 13:27:59 GMT
  8. X-Nntp-Posting-Host: chang.unx.sas.com
  9. References: <381.6657T11T967@mistral.co.uk> <Pine.A32.3.91.960324124636.16067A-100000@red.weeg.uiowa.edu> <19960325.7D4A7F8.6B80@mojaveg.ridgecrest.ca.us>
  10. Organization: SAS Institute Inc.
  11.  
  12. In article <19960325.7D4A7F8.6B80@mojaveg.ridgecrest.ca.us>,
  13. Everett M. Greene <mojaveg@mojaveg.ridgecrest.ca.us> wrote:
  14. >In article <Pine.A32.3.91.960324124636.16067A-100000@red.weeg.uiowa.edu>
  15. >    The Amorphous Mass <robinson@blue.weeg.uiowa.edu> writes:
  16. >> On 24 Mar 1996, Adam Atkinson wrote:
  17. >> 
  18. >> > my c compiler (SAS/C version 6.56) creates a warning about the following:
  19. >> > 
  20. >> >                         printf("%u %u %u \n", i, l, h);
  21. >> > 
  22. >> > three.c 36 Warning 104: conversion from pointer to const/volatile to 
  23. >> > pointer to non-const/volatile
  24. >> > What am I doing wrong? i,l and h are unsigned longs.
  25. >> 
  26. >>  That's a very curious error.  The problem seems to be that you're passing 
  27. >> longs to printf and telling printf that they're ints.  Try using %lu instead 
  28. >> of %u.
  29. >
  30. >Notice that it's not an error, only a warning.  i, l, or h has been
  31. >defined as const?
  32. >
  33.  
  34. That wouldn't explain the problem.  Neither would the %u instead of %lu.
  35. (although the observation is correct and will make a difference if the
  36. program is compiled with short ints).
  37.  
  38. There is not enough information here to say why this warning is produced.  I'd
  39. check to make sure some header file isn't #defining printf first, then I'd check
  40. to make sure that the warning isn't being produced due to a previous line of
  41. code that doesn't have a semicolon.  If you still can't figure it out, post a
  42. COMPILABLE example that only uses system #include files.
  43.  
  44. -- 
  45.   *****     
  46.  *|_o_o|\\     Doug Walker   walker@unx.sas.com  
  47.  *|. o.| ||                
  48.   | o  |//     Any opinions are mine, not those of SAS Institute, Inc.
  49.   ====== 
  50.