Thread: Warning "Suspicious pointer conversion" using Borland C++ version 4.52 IDE

  1. #1
    Registered User
    Join Date
    Aug 2012
    Posts
    21

    Unhappy Warning "Suspicious pointer conversion" using Borland C++ version 4.52 IDE

    I ran out of DGROUP memory so I had to create the following variable
    Code:
    volatile char far strfarResponseString[4096];
    I created a far pointer in my function and used it as below

    Code:
    void DownloadAFile(char *strDirectory,char *strFileName)
    {
    char far *RspPtr; //Four byte Pointer
    more code
    RspPtr = &strfarResponseString[0];
    more code
    }
    When I "build all" I get a "Suspicious pointer conversion" warning at
    Code:
    RspPtr = &strfarResponseString[0];
    The program works. But is there some way I can get rid of the warning?

    Jerry

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Well you need to decide whether "volatile" is a useful qualifier.

    The "suspicious" part is that your new pointer isn't volatile.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Aug 2012
    Posts
    21
    It has been many years since I did much C programming but I Have Been Given the job of adding some capabilities to an existing program. Every variable introduced outside a function is either given the volatile or extern qualifier. I don’t think there are any background functions. So, I should be able to drop the volatile. After doing that for strfarResponseString I only have 108 warnings left.

    Thank you for the lead. I'm going to try to cut these down.

    Jerry

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 03-12-2011, 06:59 PM
  2. Replies: 14
    Last Post: 11-08-2010, 01:47 AM
  3. Replies: 6
    Last Post: 04-05-2010, 09:09 AM
  4. Replies: 2
    Last Post: 05-21-2008, 02:52 PM
  5. Suspicious Pointer Conversion
    By mr_spanky202 in forum C Programming
    Replies: 35
    Last Post: 04-11-2003, 12:35 PM