Skip to content

Getting rid of conversion from ‘long unsigned int’ to ‘unsigned int' may change value-messages#24

Closed
medithe wants to merge 1 commit intononstd-lite:masterfrom
medithe:patch-1
Closed

Getting rid of conversion from ‘long unsigned int’ to ‘unsigned int' may change value-messages#24
medithe wants to merge 1 commit intononstd-lite:masterfrom
medithe:patch-1

Conversation

@medithe
Copy link
Copy Markdown
Contributor

@medithe medithe commented Aug 20, 2018

When compiling with -Wconversion in gcc 8, I'm getting the following warning:

error: conversion from ‘long unsigned int’ to ‘unsigned int’ may change value [-Werror=conversion]

This warning can be removed relatively simply by the following commit.

@martinmoene
Copy link
Copy Markdown
Collaborator

Perhaps instead replace unsigned in

template <unsigned A, unsigned S>
struct alignment_logic
{
    enum { value = A < S ? A : S };
};

with size_t ?

@medithe
Copy link
Copy Markdown
Contributor Author

medithe commented Aug 20, 2018

Yup, as @martinmoene mentioned in

Perhaps instead replace unsigned in
template<unsigned A, unsigned S>
struct alignment_logic
{
enum { value = A < S ? A : S };
};
with size_t ?,

this would be a better idea, therefore, I have proposed a new pull request with the number #25.

@medithe medithe closed this Aug 20, 2018
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