Bug 54814

Summary: generates bad prototype for functions returning const pointers
Product: [Retired] Red Hat Linux Reporter: Ian Romanick <idr>
Component: cprotoAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1CC: dickey, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-04 04:55:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 114963    

Description Ian Romanick 2001-10-19 17:12:47 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.5) Gecko/20011012

Description of problem:
cproto generates prototypes of the form:

extern const char * foo( void ) = {0};

for functions of the form

const char * foo( void )
{
    return( NULL );
}

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.Create a file called x.c with the single line "const char
*foo(void){return (void*)0;}"
2.Run "cproto x.c"

	

Actual Results:  cproto produced the output:

/* x.c */
const char *foo(void) = {0};


Expected Results:  I expected cproto to produce:

/* x.c */
const char *foo(void);


Additional info:

Comment 1 Thomas E. Dickey 2004-03-20 19:02:04 UTC
This doesn't happen for a current version of cproto.
See http://invisible-island.net/cproto/

Comment 2 Bill Nottingham 2004-05-04 04:55:04 UTC
Fixed in 4.7c-1.