|
Bugzilla – Full Text Bug Listing |
| Summary: | returning pointer to local variable | ||
|---|---|---|---|
| Product: | [openSUSE] SUSE LINUX 10.0 | Reporter: | David Binderman <dcb314> |
| Component: | Basesystem | Assignee: | Dr. Werner Fink <werner> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Minor | ||
| Priority: | P5 - None | ||
| Version: | Final | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | SuSE Linux 10.0 | ||
| Whiteboard: | |||
| Found By: | Other | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
|
Description
David Binderman
2005-10-21 10:02:50 UTC
This should do the job return (Char*)&s[0]; at least for gcc 4.1. Remaining warnings g31:src # grep warning: /.build.log | wc -l 332 >This should do the job I've had a think about it, and I don't think so. Adding the trailing [ 0], as far as I know, doesn't help. s is a local variable on the stack. Taking it's address as return value is surely a mistake, isn't it ? I think my original advice still stands. >332 remaining warnings. Good job I'm only looking at the serious ones ;-> Hmmm ... gcc 4.1 reports the same error without '[0]' but
no one with the choosen element. It seems that the gcc
reports the address of the String object specified to
stringcopy() .. what does the Intel compiler do in this
case? Otherwise I could also use a pointer intstead of
using an array.
|