aws / aws/aws-encryption-sdk-c

t_local_cache_threading.c:85:12: error: incompatible pointer to integer conversion

Open
#807 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
63
Forks
59
PR merge metrics
No merged PRs in 30d

Description

### Problem:
On MacOS using Homebrew I'm unable to compile with the following error:

```
[ 80%] Building C object tests/CMakeFiles/test_local_cache_threading.dir/integration/t_local_cache_threading.c.o
aws-encryption-sdk-c/tests/integration/t_local_cache_threading.c:85:12: error: incompatible pointer to integer conversion returning 'aws_thread_id_t' (aka 'struct _opaque_pthread_t *') from a function with result type 'unsigned long' [-Wint-conversion]
return aws_thread_current_thread_id();
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

### Solution:

I propose to forcibly cast to the return type to unsigned long.

### Out of scope:

Nothing

[//]: # (NOTE: If you believe this might be a security issue, please email aws-security@amazon.com instead of creating a GitHub issue. For more details, see the AWS Vulnerability Reporting Guide: https://aws.amazon.com/security/vulnerability-reporting/ )

Contributor guide

Open the contributing guide

Research direction

Inspect tests/integration/t_local_cache_threading.c at line 85 and the aws_thread_current_thread_id() call that produces the MacOS conversion error. Reproduce the CMake build on MacOS with Homebrew, then verify the proposed return-type handling and confirm that the test target compiles successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
build-system, testing
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.