So lately I've been writing stuff where I have to use a lot of uint8/uint16 and mix them with each other and integer literals. So I'm getting warnings such as:
warning: conversion to 'u16int' from 'int' may alter its value
Code:
u16int attr = attr_byte << 8;
I like compiling with lots of warnings on. I do not like getting warnings. Is there some (preferably clean) way to fix this?
You can always cast:
u16int attr = (u16int)(attr_byte << 8);
I.e. you tell the compiler you know what you are doing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With