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

Cast line_num to allow compilation with -WConversion #721

Merged
merged 1 commit into from Apr 8, 2024

Conversation

sdimovv
Copy link
Contributor

@sdimovv sdimovv commented Apr 7, 2024

I wanted to compile my unit tests with -WConversion but it failed with:

...
MyRunner_Runner.c:95:35: error: conversion to ‘UNITY_UINT’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Werror=sign-conversion]
   95 |     Unity.CurrentTestLineNumber = line_num;
      |                                   ^~~~~~~~

Adding an explicit cast before fixes the problem.

@mvandervoord mvandervoord merged commit c2637c5 into ThrowTheSwitch:master Apr 8, 2024
4 checks passed
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.

None yet

2 participants