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++/11775] New: "Control reaches end" warning issued for __attribute__((naked)) functions


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11775

           Summary: "Control reaches end" warning issued for
                    __attribute__((naked)) functions
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pgonzalez at bluel dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: arm-arm-elf

If I run "g++ test.cpp -c -Wall" on the attached source code,
the following warning is reported:

test.cpp: In function `int test()':
test.cpp:5: warning: control reaches end of non-void function

This does not make sense, and there is no way to selectively
disable the warning.  GCC 3.3.1 has the same behavior.
___________

__attribute__((naked))
int test() {
  asm("mov r0, #1");  // custom assembly
}


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