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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:57:16+00:00 2026-06-08T11:57:16+00:00

typedef char bool; doesn’t work (Edit: it doesn’t compile for fatal error C1004: unexpected

  • 0
typedef char bool;

doesn’t work (Edit: it doesn’t compile for “fatal error C1004: unexpected end-of-file found”, not just about inference by Intellisense). Reason I assume is that bool is one of the reserved keywords in Microsoft Visual C/C++. Since I need boolean type of literal name as exact “bool” (That means, type names other than bool, such as

boolean
BOOLEAN
BOOL
Bool
...

are not allowed), is there a compiling option perhaps I can use to override the keyword “bool” which is NOT in ANSI C(ISO/IEC-9899:1990) Microsoft Visual C/C++ complies with?

NB: THIS IS NOT ABOUT C++ or VISUAL C++ AT ALL. IT’S ABOUT PROGRAMMING IN ANSI C 90 WITH MSVC COMPILER IN COMPATIBLE MODE.

Thanks in advance.

Supplementary

Compiling option: /TC /Za

/* ANSI C file main.c */

typedef char bool;

int main(int argc, char * argv[])
{
    return 0;
}

(Edit: This problem has been figured out. For this case – typedef char bool – in terms of ANSI C, one can’t disable Microsoft language extension by setting /Za option to work around, though Microsoft suggests the opposite. Such incoherence might be treated as a potential bug in Visual Studio 2012 RC)

  • 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-08T11:57:17+00:00Added an answer on June 8, 2026 at 11:57 am

    There is an option for the the file where you can choose what type to compile as (you can choose C or C++)

    Also, have you tried stdbool.h

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

Sidebar

Related Questions

How does the following code work? typedef char (&yes)[1]; typedef char (&no)[2]; template <typename
Is there any downside to using typedef char bool; enum boolean { false, true
If I have a structure such as typedef struct _people { char *name; bool
I'm looking at LPSTR which is defined as typedef char* PSTR, *LPSTR; The documentation
this is my struct typedef struct { char mmsi[10]; char name[20]; double latitude; double
I structures like the following typedef struct { char *ptr; size_t used; size_t size;
Do you prefer to see something like t_byte* (with typedef unsigned char t_byte )
I have a structure typedef struct store { char name[11]; int age; } store;
If I have a struct like this: typedef struct { unsigned char c1; unsigned
I have a struct like this typedef struct bookStruct { char title[80]; char author[80];

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.