[llvm-bugs] [Bug 51889] New: error: comparison of distinct pointer types ('int *' and 'int * __ptr32')

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Sep 17 06:37:20 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51889

            Bug ID: 51889
           Summary: error: comparison of distinct pointer types ('int *'
                    and 'int * __ptr32')
           Product: clang
           Version: 12.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: akhuang at google.com
          Reporter: ararmine2 at gmail.com
                CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
                    richard-llvm at metafoo.co.uk

1. cat test.cpp 

extern "C"
int printf(const char *,...);

int* b = (int*)-1;

int main()
{   
  if (b == (int * __ptr32) -1)
    printf("values are the same\n");
  else
    printf("values are different\n");
}

2. clang -fsyntax-only -target x86_64-windows-msvc -fms-extensions test.cpp

test.cpp:8:9: error: comparison of distinct pointer types ('int *' and 'int *
__ptr32')
  if (b == (int * __ptr32) -1)
      ~ ^  ~~~~~~~~~~~~~~~~~~
1 error generated.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210917/b2376020/attachment-0001.html>


More information about the llvm-bugs mailing list