• 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: Calling fopen() from a simple C++ program in Xcode 5.0.2 raises EXC_BAD_ACCESS, code=2
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling fopen() from a simple C++ program in Xcode 5.0.2 raises EXC_BAD_ACCESS, code=2


  • Subject: Re: Calling fopen() from a simple C++ program in Xcode 5.0.2 raises EXC_BAD_ACCESS, code=2
  • From: Sean McBride <email@hidden>
  • Date: Fri, 03 Jan 2014 14:31:40 -0500
  • Organization: Rogue Research Inc.

On Mon, 23 Dec 2013 23:45:57 -0600, Ken Thomases said:

>>     const size_t inBufferSize = 10000000; // about 10 MB
>
>>         char buffer[inBufferSize];
>
>The default stack size is 8MB.  Your "buffer" variable exceeds that.  I
>suspect that's the problem.  Don't put such large buffers on the stack.
>Allocate them on the heap.

gcc can warn about that:

g++ -fsyntax-only -Wlarger-than=2000 test.cxx

test.cxx:6:26: warning: size of ‘buffer’ is 10000000 bytes [-Wlarger-than=]
  char buffer[inBufferSize];
                          ^

Alas, clang doesn't support -Wlarger-than:

<http://llvm.org/bugs/show_bug.cgi?id=10623>

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada

 _______________________________________________
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


  • Prev by Date: Re: Strange behavior of -Wfloat-equal on clang (Xcode 5)
  • Next by Date: Re: Strange behavior of -Wfloat-equal on clang (Xcode 5)
  • Previous by thread: Re: Connections Inspector sometimes omits Sent Actions
  • Next by thread: Constraints to TopLayoutGuide
  • Index(es):
    • Date
    • Thread