This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/69415] -Wmisleading-indentation warns on "if (__b < __a) return __b; return __a;"


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

--- Comment #9 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
Similar issue seen here:
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811579
Package: mosh

> make[5]: Entering directory '/<<PKGBUILDDIR>>/src/protobufs'
...
> userinput.pb.cc: In member function 'virtual bool ClientBuffers::Instruction::IsInitialized() const':
> userinput.pb.cc:375:53: error: statement is indented as if it were guarded by... [-Werror=misleading-indentation]
>    if (!_extensions_.IsInitialized()) return false;  return true;
>                                                      ^~~~~~
> 
> userinput.pb.cc:375:3: note: ...this 'if' clause, but it is not
>    if (!_extensions_.IsInitialized()) return false;  return true;
>    ^~

The code looks like it was autogenerated from:
 
https://github.com/mobile-shell/mosh/blob/master/src/protobufs/userinput.proto
presumably using https://github.com/google/protobuf

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]