incompatible pointer type C/C++ Origin: Application & API OSI layer 7 · Application Last updated 28 Nov 2026

C: warning/error: passing argument from incompatible pointer type [-Wincompatible-pointer-types]

A pointer of one type is passed where another pointer type is expected.

Exact message you may see incompatible pointer typepassing argument from incompatible pointer type
Seen on: C GCC

Meaning

GCC 14 turned this warning into an error by default, breaking older C code that compiled before.

Common causes

  • Wrong pointer type (int* vs long*)
  • const mismatch
  • Callback signature differs
  • Upgrading to GCC 14

⚡ Quick fix

  1. Cast deliberately or fix the type
  2. Fix function signature
  3. Use -Wno-error=incompatible-pointer-types as a stopgap

Detailed fix by platform

GCC 14

  1. CFLAGS+=-Wno-error=incompatible-pointer-types for legacy code

How to diagnose

  1. Types — Which two?
  2. GCC — Version 14?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Application & API. Errors that are often confused with or caused by this one (click to open):

address of local variable returned — C/C++: warning: address of local variable 'x' returned [-Wreturn-local-addr] (C/C++)address of local vari…discards qualifiers — C++: error: passing 'const X' as 'this' argument discards qualifiers [-fpermissive] (C/C++)discards qualifiersinvalid memory address or nil pointer dereference — Go: panic: runtime error: invalid memory address or nil pointer dereference (Go)invalid memory addres…ISO C++ forbids converting a string constant — C++: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] (C/C++)ISO C++ forbids conve…makes pointer from integer without a cast — C: warning: assignment makes pointer from integer without a cast (C/C++)makes pointer from in…may be used uninitialized — C/C++: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized] (C/C++)may be used uninitial…will be initialized after — C++: warning: 'X::a' will be initialized after 'X::b' [-Wreorder] (C/C++)will be initialized a…incompati…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.