https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120988

            Bug ID: 120988
           Summary: -Wconversion warning for uint /= ulong makes no sense
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

void f(unsigned int ui, unsigned long ul)
{
  ui /= ul;
}

div.cc:3:6: warning: conversion from ‘long unsigned int’ to ‘unsigned int’ may
change value [-Wconversion]
    3 |   ui /= ul;
      |   ~~~^~~~~


This warning is wrong, there is no way for this to change the value.

Reply via email to