Jump to content
Sign in to follow this  
nateman1352

Binary Constant Definitions

Recommended Posts

Hi,

 

I just recently downloaded your Boost C compiler. I'm new to PIC programming, though I am an advanced C++ programmer and have been coding for several years. One little anonyance I noticed with your compiler is the definition of integer binary constants. With your compiler a constant integer is defined as follows:

 

11111110b

(corresponding to the decimal value 254)

 

While I know that the ANSI standard does not define a method of declaring integer constants in binary (they expect you to do 0xFE in this case.) It would be nice if your compiler would accept the following notation:

 

0b11111110

 

As all of the other C compilers that support defining binary integer constants that I have used do it that way, it flows much more logically from the '0x' notation ANSI C uses.

 

Thank you for your time.

Share this post


Link to post
Share on other sites

I want to note that this topic title is a bit misleading. The binary constants are not part of ANSI "C". However it seems that people find it useful to use binary constants in form of 0bBBBBBB (and this is already implemented in some C compilers). We have added support of such constants to BoostC too. This feature will be available in the next BoostC release.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...