Re: A: a new bug to old plain C
Segher Boessenkool <[email protected]>
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <aTYDat6PmugEV9ou@gate> |
On Sun, Dec 07, 2025 at 01:49:46PM -0800, Andrey Tarasevich wrote: > > > There are lots and lots of > > > conversions in C that are only available through _explicit_ _casts_ > > > > Where "lots and lots" means "exactly zero": you can always do an > > ssignment to something with an appropriate type. > > I'm not sure what you are trying to say here. Constraints of assignment in C are exactly > as strict as constraints of initialization. (In fact, the later are defined in the standard > simply by a direct reference to the former.) I am saying that explicit casts (which means using a cast operator) are never ever required. And no, you never have to go via pointer stuff either. Just assign to something that actually holds the type you are trying to convert to. Don't hide aything! It won't help you! Segher