iden3 / circom

zkSnark circuit compiler
GNU General Public License v3.0
1.28k stars 244 forks source link

Circuit named main.circom produced malformed code when using --c #185

Closed StefanosChaliasos closed 1 year ago

StefanosChaliasos commented 1 year ago

If you save any circuit in a file named main.circom and use the --c option, the compiler will produce malformed cpp files. As a quick fix, I propose just printing a warning message when someone tries to use --c with a file called main.circom (and maybe adding a warning in the documentation).

clararod9 commented 1 year ago

Hi!

Thank you for reporting this issue. We have solved it in our last release (v2.1.6). In the current version if the name of the circuit is main.circom (or any of the other reserved names) and the --c flag is activated, we rename the file adding _c at the end of the name and print a warning. This way, if the circuit is named main.circom and the --c flag is used, then the generated files are renamed to main_c

StefanosChaliasos commented 1 year ago

Great! Thanks a lot!