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

  • SEARCH
  • Home
  • 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 666999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:52:49+00:00 2026-05-13T23:52:49+00:00

symbol.c: In function ‘symbol_FPrint’: symbol.c:1209: warning: format ‘%ld’ expects type ‘long int’, but argument

  • 0

symbol.c: In function ‘symbol_FPrint’:

symbol.c:1209: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL'
symbol.c: In function 'symbol_FPrintOtter':
symbol.c:1236: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL'
symbol.c:1239: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL'
symbol.c:1243: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL'
symbol.c:1266: warning: format '%ld' expects type 'long int', but argument 3 has type 'SYMBOL' 

In symbol.c

1198 #ifdef CHECK
1199     else {
1200       misc_StartErrorReport();
1201       misc_ErrorReport("\n In symbol_FPrint: Cannot print symbol.\n");
1202       misc_FinishErrorReport();
1203     }
1204 #endif
1205   }
1206   else if (symbol_SignatureExists())
1207     fputs(symbol_Name(Symbol), File);
1208   else
1209     fprintf(File, "%ld", Symbol);
1210 }

And SYMBOL is defined as:

typedef size_t SYMBOL

When i replaced ‘%ld’ with ‘%zu’ , i got the following warning:

symbol.c: In function 'symbol_FPrint':
symbol.c:1209: warning: ISO C90 does not support the 'z' printf length modifier

Note: From here it has been edited on 26th of march 2010 and and following problem has beeen added because of its similarity to the above mentioned problem.

I have following statement:

printf("\n\t %4d:%4d:%4d:%4d:%4d:%s:%d", Index, S->info, S->weight,
       Precedence[Index],S->props,S->name, S->length);

The warning I get while compiling in 64 bit architecture is :

format ‘%4d’ expects type ‘int’, but argument 5 has type ‘size_t’

here are the definitions of parameter:

  NAT    props;
  typedef  unsigned int     NAT;

How can i get rid of this so that i can compile without warning in 32 and 64 bit architecture?

What can be its solution?

  • 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-05-13T23:52:50+00:00Added an answer on May 13, 2026 at 11:52 pm

    Use %zu rather than %ld as the format for size_t and then you’ll get correct behaviour (and no warnings) in both 32-bit and 64-bit builds.

    If for some reason you can’t use %zu (e.g. old or non-standard compiler), then you can do something like this:

    #ifdef __LP64__ // if 64 bit environment
    #define FMT_SIZE_T "llu"
    #else
    #define FMT_SIZE_T "lu"
    #endif
    

    Then when you need to use printf with somethign of type size_t you can do this:

    printf("(sizeof(void *) = %"FMT_SIZE_T" bytes \n", sizeof(void *));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

symbol.h:179: note: expected ‘uintptr_t *’ but argument is of type ‘PRECEDENCE’ The corresponding code
How to call a name-mangled symbol from C? module.name:version void* function(TypeSig); // Type of
git grep fizzbuzz $(git rev-list --all) fatal: Invalid object name 'Symbol's function definition is
I have the following error: LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
The symbol is in the file. I verified it using nm & grep but
lint produces some warning like: foo.c XXX Warning 534: Ignoring return value of function
I have a function that finds any ISO 8859-1 symbol within a given string,
ld: duplicate symbol StringFunctions::intToString(int) in /Build/Intermediates/Y36PJC-mrvikmil.build/Debug/Y36PJC-mrvikmil.build/Objects-normal/x86_64/ServerSocket.o and /Build/Intermediates/Y36PJC-mrvikmil.build/Debug/Y36PJC-mrvikmil.build/Objects-normal/x86_64/main.o for architecture x86_64 function StringFunctions::intToString(int) is
Why do I get the error: Symbol's function definition is void: completion-at-point When I
I have a symbol a bound to a function: (defn a [] (println Hello,

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.