• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Question about a gcc 4 warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about a gcc 4 warning


  • Subject: Re: Question about a gcc 4 warning
  • From: Lawrence Gold <email@hidden>
  • Date: Fri, 12 Aug 2005 18:20:44 -0600

Kevin Hoyt wrote:
Hi all,
Just a quick question about a warning from gcc 4.

given this code

fileName[] = "myfile";
char *path=StrDup(path=NULL, fileName);

You have a case of modifying a variable twice without an intervening sequence point:


http://www.embedded.com/shared/printableArticle.jhtml?articleID=9900661

It's quite possible that your example is unambiguous, but why set path to null when you're just going to reassign it anyway? Wouldn't

	char *path=StrDup(NULL, fileName);

work just as well and be clearer?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Question about a gcc 4 warning (From: Kevin Hoyt <email@hidden>)

  • Prev by Date: Re: Can a private framework have a version and compelled to launch according to OS version?
  • Next by Date: Re: Issues and questions about Xcode 2.1
  • Previous by thread: Question about a gcc 4 warning
  • Next by thread: Xcode suddenly stopped finding my Framework headers with spaces in path
  • Index(es):
    • Date
    • Thread