# C: warning: assignment makes pointer from integer without a cast

**Code:** `makes pointer from integer without a cast` · **Category:** C/C++ · **Seen on:** C, GCC, Clang

An integer is assigned to a pointer (or the reverse) without conversion — often because a function was implicitly declared.

## Meaning

On 64-bit systems an implicit `int` return truncates pointers, causing crashes. This often accompanies `implicit declaration of function`.

## Common causes

- Missing header so function assumed to return int (`malloc` without `<stdlib.h>`)
- Assigning an int to a pointer

## Quick fix

1. Include the right header
2. Cast intentionally with `(intptr_t)`

## Detailed fix by platform

### GCC

1. Treat as error: `-Werror=int-conversion -Werror=implicit-function-declaration`

## How to diagnose

1. **Header** — Included?
2. **Types** — Pointer vs int?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cpp/makes-pointer-from-integer-without-cast)
