Re: A simple query about memory mgmt | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On 13-08-08 07:38, Manish Katiyar wrote:
On Wed, Aug 13, 2008 at 10:07 AM, Rene Herman <rene.herman@xxxxxxxxxxxx> wrote:
int main() { char *p_name = "santosh"; char *q_name = "santosh";
It is unspecified whether or not the compiler will allocate one or two copies of the character sequence "santosh" and therefore whether or not p_name != q_name;Refer to below link ...... first bullet clearly says that gcc will store only one copy if strings are identical. http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Incompatibilities.html
It clearly says that gcc version 3.4.6 will do so. And it makes perfect sense to do so ofcourse but as far as C the language is concerned, it's unspecified and I can assure you that I've used compilers that did not.
(whether or not I was happy to be using those compilers is secondary) Rene. -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ
[Newbies FAQ] [Kernel List] [Site Home] [IETF Annouce] [Git] [Networking] [Security] [Bugtraq] [Rubini] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux Networking] [Linux RAID] [Linux SCSI] [Linux ACPI] [DDR & Rambus] [UNIX Filesystems] [Linux Resources]
![]() |
![]() |