Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:38:55+00:00 2026-06-13T11:38:55+00:00

I need help with a compile error that I am getting. The error is:

  • 0

I need help with a compile error that I am getting.

The error is:
error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]

on the following line

PRINT_INDENT("Inode2 PTR: %p\n", (void *)ptr);

Context

unsigned int ptr;
memcpy(&ptr, value, sizeof(ptr));
PRINT_INDENT("Inode2 PTR: %p\n", (void *)ptr);

#define PRINT_INDENT(...) ({int __j = indent_level; while (__j-- > 0) printf("  "); printf(__VA_ARGS__);})
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:38:56+00:00Added an answer on June 13, 2026 at 11:38 am

    Are you using a 64-bit platform with 32-bit ints? If so, the error is self-explanatory. ptr is a 32-bit variable, and you’re casting it to a 64-bit void *. A workaround is to first cast it to an unsigned long long and then cast the result to a void *.

    PRINT_INDENT("Inode2 PTR: %p\n", (void *)(unsigned long long)ptr);
    

    But why are you doing this? Why not just print ptr as an unsigned int instead of casting it to a void * as follows:

    PRINT_INDENT("Inode2 PTR: %u\n", ptr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help solving some compile errors. I was following a tutorial (at
I need some help in figuring a compiler error which is really driving me
I need some help on compiler flags in c++. I'm using a library that
Need help with a query that I wrote: I have three tables Company id
Need help getting Ember-Data working with Zend Rest. At first, I'm familiar with Zend
Need help writing a script downloads data from google insight using c# this is
I'm writing a C++ program and I need some help understanding an error. By
I really need help on getting a simple GTK program in c++ running using
Can some please help? I cannot figure out why I am getting this error
I need help about that script. BOOL Checking(LPCSTR MacID) { char ClientMacs[18] = {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.