1 / 4
Jul 2014

I am trying to solve the challenge Prime Checker (PRIC).

The problem states, that the size of the source file must be less than 4096 bytes. Mine is currently 1020 bytes long, but when I submit I still get the following compile error:[b]

g++: Internal error: File size limit exceeded (program as)
Please submit a full bug report.
See for instructions.[/b]

I am confused. Are included headers also counted into this size? I only use the header iostream which is necessary for I/O.

  • created

    Jul '14
  • last reply

    Jul '14
  • 3

    replies

  • 948

    views

  • 2

    users

I was just about to post an update to this thread. Of course headers are not counted in this file size. However the g++ compiler has a strange behavior that was unknown to me. I have tried to initialize a bool array like this: bool arr[N]{true};

The compiler replaces the solitary true with N amount of it. So for example bool arr[10]{true} becomes bool arr[10]{true,true,true,true,true,true,true,true,true,true}

This caused my file to be larger than the limit. I instead used memset to fastly initialize the array.

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 15 8d

Want to read more? Browse other topics in C and C++ or view latest topics.