Skip to content
New issue

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

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

Already on GitHub? # to your account

CppUTest: fix integer conversion warning in gettid() #87

Merged
merged 1 commit into from
Feb 24, 2022

Conversation

pcolberg
Copy link
Contributor

@pcolberg pcolberg commented Feb 24, 2022

The cast is required since syscall() provides a generalized interface.

See, e.g. https://github.com/elogind/elogind/blob/06e702c9dafa3ea1dd6df8ee8cb4dcf417a0d442/src/basic/missing_syscall.h#L76-L87

[19/113] Building CXX object lib/CppUTest/CMakeFiles/CppUTest.dir/src/UtestPlatformGcc.cpp.o
../lib/CppUTest/src/UtestPlatformGcc.cpp: In function ‘pid_t gettid()’:
../lib/CppUTest/src/UtestPlatformGcc.cpp:59:50: warning: conversion to ‘pid_t {aka int}’ from ‘long int’ may alter its value [-Wconversion]
 static inline pid_t gettid(void) { return syscall( __NR_gettid ); }
                                           ~~~~~~~^~~~~~~~~~~~~~~

Prerequisite of #85

The cast is required since syscall() provides a generalized interface.

See, e.g. https://github.com/elogind/elogind/blob/06e702c9dafa3ea1dd6df8ee8cb4dcf417a0d442/src/basic/missing_syscall.h#L76-L87

[19/113] Building CXX object lib/CppUTest/CMakeFiles/CppUTest.dir/src/UtestPlatformGcc.cpp.o
../lib/CppUTest/src/UtestPlatformGcc.cpp: In function ‘pid_t gettid()’:
../lib/CppUTest/src/UtestPlatformGcc.cpp:59:50: warning: conversion to ‘pid_t {aka int}’ from ‘long int’ may alter its value [-Wconversion]
 static inline pid_t gettid(void) { return syscall( __NR_gettid ); }
                                           ~~~~~~~^~~~~~~~~~~~~~~
@pcolberg pcolberg self-assigned this Feb 24, 2022
@pcolberg pcolberg merged commit 1dd236b into intel:main Feb 24, 2022
@pcolberg pcolberg deleted the cpputest-gettid branch February 24, 2022 17:00
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants