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 6688527
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:24:50+00:00 2026-05-26T05:24:50+00:00

Why is this a warning? I think there are many cases when is more

  • 0

Why is this a warning? I think there are many cases when is more clear to use multi-char int constants instead of “no meaning” numbers or instead of defining const variables with same value. When parsing wave/tiff/other file types is more clear to compare the read values with some ‘EVAW’, ‘data’, etc instead of their corresponding values.

Sample code:

int waveHeader = 'EVAW';

Why does this give a warning?

  • 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-26T05:24:51+00:00Added an answer on May 26, 2026 at 5:24 am

    According to the standard (§6.4.4.4/10)

    The value of an integer character constant containing more than one
    character (e.g., ‘ab’), […] is implementation-defined.

    long x = '\xde\xad\xbe\xef'; // yes, single quotes
    

    This is valid ISO 9899:2011 C. It compiles without warning under gcc with -Wall, and a “multi-character character constant” warning with -pedantic.

    From Wikipedia:

    Multi-character constants (e.g. ‘xy’) are valid, although rarely
    useful — they let one store several characters in an integer (e.g. 4
    ASCII characters can fit in a 32-bit integer, 8 in a 64-bit one).
    Since the order in which the characters are packed into one int is not
    specified, portable use of multi-character constants is difficult.

    For portability sake, don’t use multi-character constants with integral types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this warning: Use of uninitialized value in eval \string\ at myscript.pl
I want to do something like this: #define EQ4(a_,b_) (*(int*)(a_)==*(int*)(b_)) char *s1 = food;
Is this warning anything to worry about? I've read that it can cause erratic
I get this warning from GCC: warning: cannot pass objects of non-POD type 'class
I am getting this warning from FxCop: 'RestartForm' contains field 'RestartForm.done' that is of
I cant understand what this warning I get on Xcode is about. Searching for
I get this: Warning: session_start(): Cannot send session cookie - headers already sent by
I get this warning in my error logs and wanted to know how to
I have this warning every time I run my CGI-script (output is rendered by
I keep getting this as a warning I want to avoid getting this warning

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.