brendan-rius / jupyter-c-kernel

Minimal Jupyter C kernel
MIT License
574 stars 144 forks source link

ANSI C and flags #55

Open teimor opened 5 years ago

teimor commented 5 years ago

First of all, great project!

When using the cflag -ansi, commenting by using // can't be used so the code won't compile and standard error is produce.

The code for test:

//%cflags:-ansi -Wall -pedantic

#include <stdio.h>

int main()
{
   printf("Hello, World!");
   return 0;
}

The Error:

/tmp/tmpuzigbjpm.c:1:1: error: C++ style comments are not allowed in ISO C90
 //%cflags:-ansi -Wall -pedantic
 ^
/tmp/tmpuzigbjpm.c:1:1: error: (this will be reported only once per input file)
[C kernel] GCC exited with code 1, the executable will not be executed

Screenshot for additional information:

screen shot 2018-12-18 at 17 42 41

Thanks!

teimor commented 5 years ago

Propose to fix this issue in - PR-56