This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH v4 12/13] test: basic c99 vla tests for C primitives


Thanks for your review.

> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com]
> Sent: Wednesday, January 15, 2014 10:39 PM
> To: Agovic, Sanimir
> Cc: palves@redhat.com; xdje42@gmail.com; gdb-patches@sourceware.org; Boell, Keven
> Subject: Re: [PATCH v4 12/13] test: basic c99 vla tests for C primitives
> 
> >>>>> "Sanimir" == Sanimir Agovic <sanimir.agovic@intel.com> writes:
> 
> Sanimir> +gdb_test "print sizeof (++int_vla\[0\])" "\\$\\d+ = ${sizeof_int}" \
> Sanimir> +         "print sizeof (++int_vla\[0\])"
> Sanimir> +gdb_test "print int_vla\[0\]" "\\$\\d+ = 42" \
> Sanimir> +         "print int_vla\[0\] - sizeof no side effects"
> 
> I didn't see any tests for the case where there should be a side effect.
> 
This line from above:
 
  gdb_test "print sizeof (++int_vla\[0\])" [...]

Is used to ensure that no side effect happen to arguments passed to sizeof.

The test is trying to express the following: 

  int i = 42; sizeof(++i); assert (i == 42)

Is it OK?

 -Sanimir
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]