samedi 30 mars 2019

Is there a way to limit data size at C++ compile time and produce a compile error?

I have build a tool that enable students to compile and test their own C++ code on line (on a protected environment).

I would like to check, at compile time, that the total amount of data size in a program does not exceed a certain size, and produce a compile error if it does.

(immediate goal : limit c++ std::array size )

I did not find information on the Web.

My compile chain is :

g++ -Wall -Wextra -Waddress -std=c++11 -lm -fstack-protector -lm -o exename srcname

Thanks for help.

Aucun commentaire:

Enregistrer un commentaire