JCluzet / GrademeBash

Automatic testing for all 42, C and CPP projects. Makefile relink, Header wrong name, Coplien Form and so much more.
296 stars 11 forks source link

ld: can't map file, errno=22 file 'union' for architecture x86_64 error in traces for union #17

Open flx25 opened 1 year ago

flx25 commented 1 year ago

Hey, i am not sure if this is an error on my side, but for the union exercise i recieve this error in the traces:

`ld: can't map file, errno=22 file 'union' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$
-------
./sourcezpadintqfwjy$
-------
./sourcedf6vwg4tha$
-------
./sourceint pha$
-------
$
-------
./sourceAat$
-------

`

my code is:

`#include <unistd.h>

void searchforletters(char *str1, char *str2, int *str1l, int *str2l)
{
    int i;
    int wrote[127] = {0};
    i = 0;
    while (str1[i])
        {
            str1l[str1[i]]++;
            i++;
        }
    i = 0;
    while (str2[i])
        {
        str2l[str2[i]]++;
        i++;
        }
    i = 0;
    while (str1[i])
    {
        if ((str1l[str1[i]] >= 1 || str2l[str1[i]] >= 1) && wrote[str1[i]] == 0)
        {
            write(1, &str1[i],1);
            wrote[str1[i]]++;
        }
        i++;
    }
    i = 0;
        while (str2[i])
    {
        if ((str1l[str2[i]] >= 1 || str2l[str2[i]] >= 1) && wrote[str2[i]] == 0)
        {
            write(1, &str2[i],1);
            wrote[str2[i]]++;
        }
        i++;
    }
    write(1, "\n", 1);

}

int main(int argc,char** argv)
{
    int str1l[127] = {0};
    int str2l[127] = {0};
    if (argc != 3)
            write(1, "\n", 1);
    if (argc == 3)
        searchforletters(argv[1], argv[2], str1l, str2l);
    return (0);
}
`