Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Get rid ofboolean type; usebool instead #4673

Open
Labels
feature requestA request to make an enhancement (not a bug fix)
@cousteaulecommandant

Description

@cousteaulecommandant

Is there a need for theboolean type at all, other than backwards compatibility?

Currently, Arduino'sboolean type is defined as an alias tobool (thanks, Chris--A!). However I don't see the need to have a customboolean type when C and C++ already provide one.
Advantages of thebool type are:

  • it is shorter
  • it is standard
  • it is consistent with other "abbreviated" C and C++ types such asint andchar

I think it would be a good idea to stop using this customboolean type and instead use thebool one; in my opinion, the fewer unneeded additions Arduino makes to the language, the better.
The steps for moving would be (in this order):

  • Replace allboolean from Arduino core and library functions withbool.
  • Update the documentation, removing all references toboolean and replacing them withbool (and maybe adding a note that theboolean type is deprecated).
  • State that theboolean type is deprecated. An__attribute__ ((deprecated ("use bool instead"))) on theboolean definition could be a good idea.
  • Eventually, a few versions after deprecatingboolean, consider its removal. (Or leave it there forever, just in case.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA request to make an enhancement (not a bug fix)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp