Skip to content

Conversation

xhernandez
Copy link
Contributor

On some systems, the 'char' type is interpreted as an unsigned char. This may cause some issues as Gluster code assumes that 'char' is signed.

This patch adds the '-fsigned-char' option during compilation to make sure it works as expected.

Updates: #1000

On some systems, the 'char' type is interpreted as an unsigned char.
This may cause some issues as Gluster code assumes that 'char' is
signed.

This patch adds the '-fsigned-char' option during compilation to make
sure it works as expected.

Updates: gluster#1000
Signed-off-by: Xavi Hernandez <[email protected]>
@xhernandez
Copy link
Contributor Author

/run regression

@amarts amarts merged commit 3fb3bb5 into gluster:devel Mar 3, 2023
@xhernandez xhernandez deleted the signed-char branch March 3, 2023 09:02
amarts pushed a commit to kadalu/glusterfs that referenced this pull request Mar 20, 2023
On some systems, the 'char' type is interpreted as an unsigned char.
This may cause some issues as Gluster code assumes that 'char' is
signed.

This patch adds the '-fsigned-char' option during compilation to make
sure it works as expected.

Updates: gluster#1000

Signed-off-by: Xavi Hernandez <[email protected]>
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Mar 9, 2025
	The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

	Thus at xlators/cluster/afr/src/afr-inode-write.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

	This commit changes the variabl "byte" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Mar 9, 2025
	The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

	Thus at xlators/cluster/afr/src/afr-inode-write.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

	This commit changes the variable "byte" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Mar 9, 2025
	The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

	Thus at xlators/cluster/afr/src/afr-inode-write.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

	This commit changes the variable "byte" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Mar 9, 2025
        The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

        Thus at xlators/features/compress/src/cdc-helper.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

        This commit changes the variable "gzip_header" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Jun 10, 2025
	The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

	Thus at xlators/cluster/afr/src/afr-inode-write.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

	This commit changes the variable "byte" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
#  xlators/cluster/afr/src/afr-inode-write.c | 2 +-
#  1 file changed, 1 insertion(+), 1 deletion(-)
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Jun 10, 2025
        The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

        Thus at xlators/features/compress/src/cdc-helper.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

        This commit changes the variable "gzip_header" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
#  xlators/features/compress/src/cdc-helper.c | 4 ++--
#  1 file changed, 2 insertions(+), 2 deletions(-)
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Jun 10, 2025
	The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

	Thus at xlators/cluster/afr/src/afr-inode-write.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

	This commit changes the variable "byte" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
#  xlators/cluster/afr/src/afr-inode-write.c | 2 +-
#  1 file changed, 1 insertion(+), 1 deletion(-)
#  xlators/cluster/afr/src/afr-inode-write.c | 2 +-
#  1 file changed, 1 insertion(+), 1 deletion(-)
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Jun 10, 2025
        The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

        Thus at xlators/features/compress/src/cdc-helper.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

        This commit changes the variable "gzip_header" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
#  xlators/features/compress/src/cdc-helper.c | 4 ++--
#  1 file changed, 2 insertions(+), 2 deletions(-)
#  xlators/features/compress/src/cdc-helper.c | 4 ++--
#  1 file changed, 2 insertions(+), 2 deletions(-)
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Jun 30, 2025
	The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

	Thus at xlators/cluster/afr/src/afr-inode-write.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

	This commit changes the variable "byte" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
#  xlators/cluster/afr/src/afr-inode-write.c | 2 +-
#  1 file changed, 1 insertion(+), 1 deletion(-)
#  xlators/cluster/afr/src/afr-inode-write.c | 2 +-
#  1 file changed, 1 insertion(+), 1 deletion(-)
#  xlators/cluster/afr/src/afr-inode-write.c | 2 +-
#  1 file changed, 1 insertion(+), 1 deletion(-)
ThalesBarretto added a commit to ThalesBarretto/glusterfs that referenced this pull request Jun 30, 2025
        The forcing of signed char type was introduced by 3fb3bb5d38r,
"configure: force 'char' type to be signed (gluster#4025)".

        Thus at xlators/features/compress/src/cdc-helper.c was found the
use of a char type to represent bytes, when it should be using an unsigned
type to avoid sign extension and overflow.

        This commit changes the variable "gzip_header" to "unsigned" type.

Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]>
#  xlators/features/compress/src/cdc-helper.c | 4 ++--
#  1 file changed, 2 insertions(+), 2 deletions(-)
#  xlators/features/compress/src/cdc-helper.c | 4 ++--
#  1 file changed, 2 insertions(+), 2 deletions(-)
#  xlators/features/compress/src/cdc-helper.c | 4 ++--
#  1 file changed, 2 insertions(+), 2 deletions(-)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants