[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RtypesCore.h does not have a signed character type #15927

Open
1 task done
dan131riley opened this issue Jun 25, 2024 · 1 comment
Open
1 task done

RtypesCore.h does not have a signed character type #15927

dan131riley opened this issue Jun 25, 2024 · 1 comment
Assignees
Labels

Comments

@dan131riley
Copy link

Check duplicate issues.

  • Checked for duplicates

Description

The Char_t typedef here:

typedef char Char_t; //Signed Character 1 byte (char)

is incorrect--a bare char is not guaranteed to be signed or unsigned.

char — type for character representation which can be most efficiently processed on the target system (has the same representation and alignment as either signed char or unsigned char, but is always a distinct type). Multibyte characters strings use this type to represent code units. For every value of type unsigned char in range [​0​, 255], converting the value to char and then back to unsigned char produces the original value.(since C++11) The signedness of char depends on the compiler and the target platform: the defaults for ARM and PowerPC are typically unsigned, the defaults for x86 and x64 are typically signed.

To actually guarantee to be a signed type, Char_t would have to be declared as signed char.

From another issue, it appears ROOT is moving away from Rtypes.h since the C++ standard has a evolved a more complete type system, so this may be a "who cares" issue...

Reproducer

n/a

ROOT version

latest

Installation method

n/a

Operating system

n/a

Additional context

No response

@ferdymercury
Copy link
Collaborator

Related:

#12208
#7565

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants