[bug] Operations such as "|=", "&=" and "^=" lack necessary implicit type conversions
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 624
- Forks
- 170
- PR merge metrics
- No merged PRs in 30d
Description
Operations such as "|=", "&=" and "^=" lack the necessary implicit type conversions, e.g. the following code will compile with the error "op requires the same type for all operands and results".
void setbit(char *set, int number, int value)
{
set += number / CHAR_BIT;
if (value)
*set |= 1 << (number % CHAR_BIT); /* set bit */
else *set &= ~(1 << (number % CHAR_BIT)); /* clear bit*/
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided setbit example and tracing the compiler's handling of compound bitwise assignments. Done means operations such as |=, &=, and ^= accept the necessary implicit type conversions and the example compiles without the reported same-type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100