On Mon, Jun 10, 2019 at 10:38 PM Vaibhav Gupta <[email protected]> wrote: > > > > On Mon, Jun 10, 2019 at 10:01 PM Gedare Bloom <[email protected]> wrote: >> >> Hi Vaibhav, >> >> This is getting better, see below for review comments. >> >> On Mon, Jun 10, 2019 at 4:48 AM Vaibhav Gupta <[email protected]> >> wrote: >> > + puts( "2 - Valid Inputs - Negative Number" ); >> > + result_strtoumax = strtoumax( nptr1_n, &endptr1, base ); >> > + puts( "Checking Results" ); >> > + rtems_test_assert( result_strtoumax == ( UINTMAX_MAX - 123 + 1 ) ); >> > + puts( "PASS" ); >> Is it expected to convert the negative number correctly like this? > > In previous code, the test was rtems_test_assert( result_strtoumax != 0 ); > On suggestion, I converted it to assert it with the output instead of zero. > . > I matched it with output, ( UINTMAX_MAX - 123 + 1 ) is giving correct result. > Can you brief, how else I should convert this negative number?
I just meant is it guaranteed that the conversion will treat a negative string as a 2s complement integer. I guess it is fine to leave it. -Gedare _______________________________________________ devel mailing list [email protected] http://lists.rtems.org/mailman/listinfo/devel
