root-project / cling

The cling C++ interpreter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

perror always return 'No such file or directory'

Freed-Wu opened this issue · comments

commented
  • Checked for duplicates

To Reproduce

[cling]$ #include <stdio.h>
[cling]$ #include <stdlib.h>
[cling]$ fopen("/root/a", "r+");
[cling]$ perror("a");
a: No such file or directory

Expected behavior

[cling]$ #include <stdio.h>
[cling]$ #include <stdlib.h>
[cling]$ fopen("/root/a", "r+");
[cling]$ perror("a");
a: Permission denied

A simpler example:

[cling]$ #include <stdio.h>
[cling]$ perror("a");
a: No such file or directory

Expected

[cling]$ #include <stdio.h>
[cling]$ perror("a");
a: Success

Setup

  1. Cling version 0.9
  2. Operating system 6.2.7-arch1-1
  3. How you obtained Cling, such as with cpt.py (also mention flags) / you built it yourself.
    pacman

Additional context