Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[HELP] trying to compile mygrep tools in termux

Featured Replies

  • Author
  • Localization

TUNBudi06, posted Wed Mar 16, 2022 3:53 am (70525)


When i try to compile it i get this error

Please help me

Code:
 qc mygrep.c
In file included from mygrep.c:60:
./scan.h:97:35: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    files[filesi].name   = strdup(fname);
                                  ^~~~~
/data/data/com.termux/files/usr/include/string.h:110:26: note: passing argument to parameter '__s' here
char* strdup(const char* __s);
                         ^
In file included from mygrep.c:60:
./scan.h:97:26: warning: assigning to 'u8 *' (aka 'unsigned char *') from 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    files[filesi].name   = strdup(fname);
                         ^ ~~~~~~~~~~~~~
./scan.h:166:9: warning: implicit declaration of function 'scandir' is invalid in C99 [-Wimplicit-function-declaration]
    n = scandir(filedir, &namelist, NULL, NULL);
        ^
./scan.h:168:17: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        if(stat(filedir, &xstat) < 0) {
                ^~~~~~~
/data/data/com.termux/files/usr/include/sys/stat.h:149:22: note: passing argument to parameter '__path' here
int stat(const char* __path, struct stat* __buf);
                     ^
In file included from mygrep.c:60:
./scan.h:176:19: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    plen = strlen(filedir);
                  ^~~~~~~
/data/data/com.termux/files/usr/include/string.h:95:27: note: passing argument to parameter '__s' here
size_t strlen(const char* __s) __attribute_pure__;
                          ^
In file included from mygrep.c:60:
./scan.h:178:12: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    strcpy(filedir plen, "/");
           ^~~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/string.h:108:20: note: passing argument to parameter '__dst' here
char* strcpy(char* __dst, const char* __src);
                   ^
In file included from mygrep.c:60:
./scan.h:182:31: error: incomplete definition of type 'struct dirent'
        if(!strcmp(namelist[i]->d_name, ".") || !strcmp(namelist[i]->d_name, "..")) continue;
                   ~~~~~~~~~~~^
./scan.h:162:13: note: forward declaration of 'struct dirent'
    struct  dirent  **namelist;
            ^
./scan.h:182:68: error: incomplete definition of type 'struct dirent'
        if(!strcmp(namelist[i]->d_name, ".") || !strcmp(namelist[i]->d_name, "..")) continue;
                                                        ~~~~~~~~~~~^
./scan.h:162:13: note: forward declaration of 'struct dirent'
    struct  dirent  **namelist;
            ^
./scan.h:184:37: error: incomplete definition of type 'struct dirent'
        namelen = strlen(namelist[i]->d_name);
                         ~~~~~~~~~~~^
./scan.h:162:13: note: forward declaration of 'struct dirent'
    struct  dirent  **namelist;
            ^
./scan.h:187:43: error: incomplete definition of type 'struct dirent'
        memcpy(filedir plen, namelist[i]->d_name, namelen);
                               ~~~~~~~~~~~^
./scan.h:162:13: note: forward declaration of 'struct dirent'
    struct  dirent  **namelist;
            ^
./scan.h:190:17: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        if(stat(filedir, &xstat) < 0) {
                ^~~~~~~
/data/data/com.termux/files/usr/include/sys/stat.h:149:22: note: passing argument to parameter '__path' here
int stat(const char* __path, struct stat* __buf);
                     ^
mygrep.c:108:14: warning: assigning to 'u8 *' (aka 'unsigned char *') from 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    g_string = argv[i ];
             ^ ~~~~~~~~~
mygrep.c:113:23: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    g_string = strdup(g_string);    // not necessary
                      ^~~~~~~~
/data/data/com.termux/files/usr/include/string.h:110:26: note: passing argument to parameter '__s' here
char* strdup(const char* __s);
                         ^
mygrep.c:113:14: warning: assigning to 'u8 *' (aka 'unsigned char *') from 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    g_string = strdup(g_string);    // not necessary
             ^ ~~~~~~~~~~~~~~~~
mygrep.c:117:17: warning: passing 'u8 [4096]' to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        sprintf(filedir, "%.*s", sizeof(filedir) - 1, argv[i]);
                ^~~~~~~
/data/data/com.termux/files/usr/include/stdio.h:165:19: note: passing argument to parameter '__s' here
int sprintf(char* __s, const char* __fmt, ...)
                  ^
mygrep.c:117:29: warning: field precision should have type 'int', but argument has type 'unsigned long' [-Wformat]
        sprintf(filedir, "%.*s", sizeof(filedir) - 1, argv[i]);
                          ~~^~   ~~~~~~~~~~~~~~~~~~~
mygrep.c:273:31: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                    if(sscanf(p 1, "x%n", &n, &len) != 1) return(-1);
                              ^~~~~
/data/data/com.termux/files/usr/include/stdio.h:141:24: note: passing argument to parameter '__s' here
int sscanf(const char* __s, const char* __fmt, ...) __scanflike(2, 3);
                       ^
mygrep.c:280:31: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
                    if(sscanf(p, "%3o%n", &n, &len) != 1) return(-1);
                              ^
/data/data/com.termux/files/usr/include/stdio.h:141:24: note: passing argument to parameter '__s' here
int sscanf(const char* __s, const char* __fmt, ...) __scanflike(2, 3);
                       ^
mygrep.c:304:20: warning: assigning to 'u8 *' (aka 'unsigned char *') from 'char [1]' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    if(!data) data = "";
                   ^ ~~
mygrep.c:306:27: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    else     len = strlen(data);
                          ^~~~
/data/data/com.termux/files/usr/include/string.h:95:27: note: passing argument to parameter '__s' here
size_t strlen(const char* __s) __attribute_pure__;
                          ^
mygrep.c:311:17: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        sprintf(ret (i * 2), "x", data[i]);
                ^~~~~~~~~~~~~
/data/data/com.termux/files/usr/include/stdio.h:165:19: note: passing argument to parameter '__s' here
int sprintf(char* __s, const char* __fmt, ...)
                  ^
mygrep.c:313:29: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    if(size) *size = strlen(ret);
                            ^~~
/data/data/com.termux/files/usr/include/string.h:95:27: note: passing argument to parameter '__s' here
size_t strlen(const char* __s) __attribute_pure__;
                          ^
mygrep.c:334:22: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
        len = strlen(data);
                     ^~~~
/data/data/com.termux/files/usr/include/string.h:95:27: note: passing argument to parameter '__s' here
size_t strlen(const char* __s) __attribute_pure__;
                          ^
mygrep.c:402:39: warning: format specifies type 'unsigned int' but the argument has type 'long' [-Wformat]
                printf("  x %s\n", p - buff, fname);
                          ~~~~        ^~~~~~~~
                          lx
mygrep.c:415:39: warning: format specifies type 'unsigned int' but the argument has type 'long' [-Wformat]
                printf("  x %s\n", p - buff, fname);
                          ~~~~        ^~~~~~~~
                          lx
mygrep.c:444:16: warning: passing 'u8 *' (aka 'unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    fd = fopen(fname, "rb");
               ^~~~~
/data/data/com.termux/files/usr/include/stdio.h:283:25: note: passing argument to parameter '__path' here
FILE* fopen(const char* __path, const char* __mode);
                        ^
22 warnings and 4 errors generated.
  • Author
  • Localization

TUNBudi06, posted Wed Mar 16, 2022 3:54 am (70526)


Bcz i your tools is is usefull for hex or basecode


That why need help

Bcz Im don't really know about c language

Please help
  • Author
  • Localization

TUNBudi06, posted Wed Mar 16, 2022 5:27 am (70527)


Well before reply this post.i already solved this problem

By include dirent.h in scan.h file

Thanks
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.