Jump to content
Sign in to follow this  

Binary Constant Definitions

Recommended Posts



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:



(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:




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.




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.

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.

Sign in to follow this  

  • Create New...