pastebin - collaborative debugging tool
rovema.kpaste.net RSS


drmemory mingw test1
Posted by Anonymous on Sat 28th Oct 2023 05:52
raw | new post
view followups (newest first): drmemory mingw test1 by Anonymous

  1. /*
  2.  * DrMemory test x1.c
  3.  *
  4.  * Compile with:
  5.  * $ x86_64-w64-mingw32-gcc -g -gdwarf-2 x1.c
  6.  *
  7.  * Test with:
  8.  * $ drmemory -batch -check_uninitialized -gen_suppress_syms -preload_symbols -- ./a
  9.  */
  10. #include <stdlib.h>
  11. #include <string.h>
  12. #include <stdio.h>
  13.  
  14. const int ar[] = { 5, 4, 3, 2, 1, 0 };
  15.  
  16. int main(int ac, char *av[])
  17. {
  18.         puts("#start");
  19.        
  20.         int *ar2 = malloc(sizeof(int)*6);
  21.         memcpy(ar2, ar, sizeof(int)*6);
  22.        
  23.         int i;
  24.         int j;
  25.         for (i=0 ; i < 16 ; i++) {
  26.                 j = ar2[i];
  27.  
  28.                 printf("i=");
  29.                 printf("%d\n", j);
  30.                 fflush(stdout);
  31.         }
  32.         puts("#end");
  33.         return 0;
  34. }

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at