Bug 54814 - generates bad prototype for functions returning const pointers
Summary: generates bad prototype for functions returning const pointers
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: cproto
Version: 7.1
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC2Target
TreeView+ depends on / blocked
 
Reported: 2001-10-19 17:12 UTC by Ian Romanick
Modified: 2014-03-17 02:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-05-04 04:55:04 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.