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/30072] New: Return type of implicitly declared functions


Return type of implicitly declared functions

Return type of an implicitly declared function is supposed to be int (signed
that is)

//temp.c
f(int i)
{
        if (g(i) < 0)
                printf("dead");
}

the return type of g(int) is int (normally)

but when the parameter list of an implicitly declared function consists of only
unsigned ints then the return type reported by the cc1 (parser) is unsigned int
(instead of signed)

//temp.c
f(unsigned int i)
{
        if (g(i) < 0)
                printf("dead");
}

the return type of g(unsigned int) becomes unsigned int :( somehow

If anyone has a clue on how to remove this and force the return type to be int
no matter what, please?


-- 
           Summary: Return type of implicitly declared functions
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bhaskar dot priya at wipro dot com


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


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