On Mon, May 15, 2017 at 3:38 PM, aditya upadhyay <aadit0...@gmail.com> wrote: > Hello All, > > I have ported the code of inttypes library and i have tested methods related > to inttypes.h in hello world test. It is working. Then i made a separate As a proof-of-concept, this is fine. You'll need to focus on the separate test case and not contribute any modifications of the hello world.
For the actual inclusion of inttypes library code, I think this code more properly belongs either in the newlib repository or underneath cpukit/libcsupport. See https://sourceware.org/newlib/ for info about joining the newlib mailing list and checking out the git repository. If it does not have a good place to go in newlib, then the code should be added underneath cpukit/libcsupport. Adding to newlib is preferred in case the implementation may be of value to other newlib users, i.e., the code is not RTEMS-specific. I did not see the patch of the code for your inttypes library below, only the patches to add it to the build system and to add the test. So I cannot comment on the adequacy of the implementation itself. > test for psxinttypes01 in samples directory and it's also working. I made > this test within the psxtests directory then how would i check whether test > is working or not ? The location of psxinttypes01 is : > /development/rtems4.12-1/testsuits/psxtests/psxinttypes01. > Good. A test is preferred to begin with, so that you may follow a test-driven development approach that is mostly used by RTEMS developers. > Just for learning purpose, if i put psxtests instead of samples in this > command : ../rtems4.12-1/configure --target=sparc-rtems4.12 > --enable-rtemsbsp=erc32 --enable-tests=samples --disable-posix > > and after make command, Will it generate .exe files related to psxtests ? enable-tests only has 3 options: samples, yes, no to generate the psxtests you need to specify --enable-tests=yes (or just --enable-tests). > do i have to send the ported code or can i submit the ported code to my > github repository.. ? Any suggestion ? > Please find the attached patch and review the tested methods. > In the future please send well-formatted git-commit patches intended for review/merge to the mailing list as separate patch files, preferably using the git-send-email. See https://devel.rtems.org/wiki/Developer/Git/Users#CreatingaPatch > patch1 is for methods tested within the hello world file. > diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am > index 1987586..5c4dc15 100644 > --- a/cpukit/Makefile.am > +++ b/cpukit/Makefile.am > @@ -7,6 +7,7 @@ include $(top_srcdir)/automake/multilib.am > SUBDIRS = . score rtems sapi posix > SUBDIRS += dev > SUBDIRS += dtc/libfdt > +SUBDIRS += inttypes > SUBDIRS += libcrypt > SUBDIRS += libcsupport libblock libfs > SUBDIRS += libdrvmgr > diff --git a/cpukit/configure.ac b/cpukit/configure.ac > index 67237e9..5110c07 100644 > --- a/cpukit/configure.ac > +++ b/cpukit/configure.ac > @@ -479,6 +479,7 @@ libstdthreads/Makefile > libdebugger/Makefile > zlib/Makefile > ftpd/Makefile > +inttypes/Makefile > telnetd/Makefile > pppd/Makefile > mghttpd/Makefile > diff --git a/cpukit/include/rtems/inttypes.h > b/cpukit/include/rtems/inttypes.h > index 2e23c8c..d2f9f55 100644 > --- a/cpukit/include/rtems/inttypes.h > +++ b/cpukit/include/rtems/inttypes.h > @@ -153,3 +153,4 @@ extern "C" { > #endif > > #endif > > diff --git a/testsuites/psxtests/Makefile.am > b/testsuites/psxtests/Makefile.am > index 7bcea46..65325da 100644 > --- a/testsuites/psxtests/Makefile.am > +++ b/testsuites/psxtests/Makefile.am > @@ -58,6 +58,7 @@ _SUBDIRS += psxhdrs > _SUBDIRS += psxintrcritical01 > _SUBDIRS += psxitimer > endif > +_SUBDIRS += psxinttypes01 > _SUBDIRS += psxkey01 > _SUBDIRS += psxkey02 > _SUBDIRS += psxkey03 > diff --git a/testsuites/psxtests/configure.ac > b/testsuites/psxtests/configure.ac > index 1de1312..227bda9 100644 > --- a/testsuites/psxtests/configure.ac > +++ b/testsuites/psxtests/configure.ac > @@ -163,6 +163,7 @@ psximfs01/Makefile > psximfs02/Makefile > psxintrcritical01/Makefile > psxitimer/Makefile > +psxinttypes01/Makefile > psxkey01/Makefile > psxkey02/Makefile > psxkey03/Makefile > diff --git a/testsuites/samples/hello/Makefile.am > b/testsuites/samples/hello/Makefile.am > index 234a27e..c7f7e2a 100644 > --- a/testsuites/samples/hello/Makefile.am > +++ b/testsuites/samples/hello/Makefile.am > @@ -9,9 +9,10 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg > include $(top_srcdir)/../automake/compile.am > include $(top_srcdir)/../automake/leaf.am > > +AM_CPPFLAGS += -I$(top_srcdir)/../support/include > > -LINK_OBJS = $(hello_OBJECTS) > -LINK_LIBS = $(hello_LDLIBS) > +LINK_OBJS = $(hello_OBJECTS) $(hello_LDADD) > +LINK_LIBS = $(hello_LDLIBS) > /home/aditya/development/b-sparc/sparc-rtems4.12/c/erc32/cpukit/inttypes/libinttypes.a > > hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES) > @rm -f hello$(EXEEXT) > diff --git a/testsuites/samples/hello/init.c > b/testsuites/samples/hello/init.c > index a2d6c30..51f4451 100644 > --- a/testsuites/samples/hello/init.c > +++ b/testsuites/samples/hello/init.c > @@ -18,6 +18,7 @@ > > #include <stdio.h> > #include <stdlib.h> > +#include <rtems/inttypes.h> > > /* forward declarations to avoid warnings */ > rtems_task Init(rtems_task_argument argument); > @@ -31,7 +32,34 @@ rtems_task Init( > { > rtems_print_printer_printf(&rtems_test_printer); > rtems_test_begin(); > + char* endptr; > + uintmax_t j,k; > + int base = 10; > + char *nptr; > + wchar_t *nptr1, *endptr1; > + intmax_t m; > + nptr1 = L"10110134932"; > + nptr = "20690239864abc"; > + m = wcstoimax(nptr1, &endptr1, base); > + printf("string = %s\n", nptr); > + j = strtoumax(nptr, &endptr, base); > + printf("wcstoimax = %jd\n", m); > + k = wcstoumax(nptr1, &endptr1, base); > + printf("wcstoumax = %ju\n", k); > + printf("strtoumax = %ju (base %d)\n", j, base); > + printf("Stopped scan at %s\n\n", endptr); > + imaxdiv_t retrival = imaxdiv(27, 4); > printf( "Hello World\n" ); > + printf(" Strtoimax values \n"); > + printf("%jd\n", strtoimax(" -123junk",&endptr,10)); /* base 10 > */ > + printf("%jd\n", strtoimax("11111111",&endptr,2)); /* base 2 > */ > + printf("%jd\n", strtoimax("XyZ",&endptr,36)); /* base 36 > */ > + printf("%jd\n", strtoimax("010",&endptr,0)); /* octal > auto-detection */ > + printf("%jd\n", strtoimax("10",&endptr,0)); /* decimal > auto-detection */ > + printf("%jd\n", strtoimax("0x10",&endptr,0)); /* hexadecimal > auto-detection */ > + printf( "imaxabs_value = %jd\n", imaxabs(-1234)); > + printf("strtoimax value = %jd\n", strtoimax("11111111",&endptr,2)); > + printf( "imax div value = %jd\n", retrival.rem); > rtems_test_end(); > exit( 0 ); > } > Remove the changes to hello world from this commit. you can do this via git using something like: git rebase -i HEAD~2 change 'pick' to 'edit' for the commit you want to change and then use git reset init.c git checkout -- init.c I think that should remove the changes made to the init.c file, but check with a git tutorial if you need further guidance. > patch2 is for separate test psxinttypes01 within the samples directory. > It is good to have separate patches produced from different git commits for the test and the implementation. > diff --git a/cpukit/Makefile.am b/cpukit/Makefile.am > index 1987586..5c4dc15 100644 > --- a/cpukit/Makefile.am > +++ b/cpukit/Makefile.am > @@ -7,6 +7,7 @@ include $(top_srcdir)/automake/multilib.am > SUBDIRS = . score rtems sapi posix > SUBDIRS += dev > SUBDIRS += dtc/libfdt > +SUBDIRS += inttypes > SUBDIRS += libcrypt > SUBDIRS += libcsupport libblock libfs > SUBDIRS += libdrvmgr > diff --git a/cpukit/configure.ac b/cpukit/configure.ac > index 67237e9..5110c07 100644 > --- a/cpukit/configure.ac > +++ b/cpukit/configure.ac > @@ -479,6 +479,7 @@ libstdthreads/Makefile > libdebugger/Makefile > zlib/Makefile > ftpd/Makefile > +inttypes/Makefile > telnetd/Makefile > pppd/Makefile > mghttpd/Makefile > diff --git a/cpukit/include/rtems/inttypes.h > b/cpukit/include/rtems/inttypes.h > index 2e23c8c..d2f9f55 100644 > --- a/cpukit/include/rtems/inttypes.h > +++ b/cpukit/include/rtems/inttypes.h > @@ -153,3 +153,4 @@ extern "C" { > #endif > > #endif > + This appears to be an unnecessary white space addition. > diff --git a/cpukit/rtems/src/ratemonreportstatistics.c > b/cpukit/rtems/src/ratemonreportstatistics.c > index 0ea7790..76f032e 100644 > --- a/cpukit/rtems/src/ratemonreportstatistics.c > +++ b/cpukit/rtems/src/ratemonreportstatistics.c > @@ -156,3 +156,4 @@ void rtems_rate_monotonic_report_statistics( void ) > rtems_print_printer_printk( &printer ); > rtems_rate_monotonic_report_statistics_with_plugin( &printer ); > } > + Get rid of this spurious change. Check the settings on your editor, it appears to be adding newlines to the end of files that you open. > diff --git a/testsuites/samples/Makefile.am b/testsuites/samples/Makefile.am > index 85e89a5..f710aab 100644 > --- a/testsuites/samples/Makefile.am > +++ b/testsuites/samples/Makefile.am > @@ -9,6 +9,7 @@ _SUBDIRS += minimum > _SUBDIRS += nsecs > _SUBDIRS += paranoia > _SUBDIRS += ticker > +_SUBDIRS += psxinttypes01 This should go instead into the psxtests rather than samples. > _SUBDIRS += unlimited > > if MPTESTS > diff --git a/testsuites/samples/configure.ac > b/testsuites/samples/configure.ac > index ffe1bad..95ff87a 100644 > --- a/testsuites/samples/configure.ac > +++ b/testsuites/samples/configure.ac > @@ -75,6 +75,7 @@ nsecs/Makefile > paranoia/Makefile > pppd/Makefile > ticker/Makefile > +psxinttypes01/Makefile ditto. > unlimited/Makefile > ]) > AC_OUTPUT > diff --git a/testsuites/samples/hello/Makefile.am > b/testsuites/samples/hello/Makefile.am > index 234a27e..3a05a39 100644 > --- a/testsuites/samples/hello/Makefile.am > +++ b/testsuites/samples/hello/Makefile.am > @@ -1,6 +1,6 @@ > > rtems_tests_PROGRAMS = hello > -hello_SOURCES = init.c > +hello_SOURCES = init.c libinttypes.a > > dist_rtems_tests_DATA = hello.scn > dist_rtems_tests_DATA += hello.doc > @@ -9,9 +9,10 @@ include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg > include $(top_srcdir)/../automake/compile.am > include $(top_srcdir)/../automake/leaf.am > > +AM_CPPFLAGS += -I$(top_srcdir)/../support/include > > -LINK_OBJS = $(hello_OBJECTS) > -LINK_LIBS = $(hello_LDLIBS) > +LINK_OBJS = $(hello_OBJECTS) $(hello_LDADD) > +LINK_LIBS = $(hello_LDLIBS) > /home/aditya/development/b-sparc/sparc-rtems4.12/c/erc32/cpukit/inttypes/libinttypes.a > You should not have hard-coded paths in code that you write. This would not work for other people. > hello$(EXEEXT): $(hello_OBJECTS) $(hello_DEPENDENCIES) > @rm -f hello$(EXEEXT) > diff --git a/testsuites/samples/hello/init.c > b/testsuites/samples/hello/init.c > index a2d6c30..d1fd577 100644 > --- a/testsuites/samples/hello/init.c > +++ b/testsuites/samples/hello/init.c > @@ -18,6 +18,7 @@ > > #include <stdio.h> > #include <stdlib.h> > +#include <rtems/inttypes.h> > > /* forward declarations to avoid warnings */ > rtems_task Init(rtems_task_argument argument); > I don't see the code for your psxinttypes01 directory. Note that you must git-add new files/directories explicitly, as git add -a will not pick up new files only modified, existing files. Gedare > Thanks & Regards, > Aditya > > On Mon, May 15, 2017 at 9:55 PM, Joel Sherrill <j...@rtems.org> wrote: >> >> I am not in a good position to review this today but patches should go to >> the community for review. Also this one has a ticket. >> >> --joel >> >> On May 14, 2017 11:33 PM, "aditya upadhyay" <aadit0...@gmail.com> wrote: >>> >>> Hello Joel, Gedare, >>> >>> I have ported the code of inttypes library and i have tested methods >>> related to inttypes.h in hello world test. It is working. I have made a test >>> related to inttypes methods named as psxinttype01. where i have tested these >>> method. The location of psxinttypes01 is : >>> /development/rtems4.12-1/testsuits/psxtests/psxinttypes01. >>> >>> Just for learning purpose, if i put psxtests instead of samples in this >>> command : ../rtems4.12-1/configure --target=sparc-rtems4.12 >>> --enable-rtemsbsp=erc32 --enable-tests=samples --disable-posix >>> >>> and after make command, Will it generate .exe files related to psxtests ? >>> do i have to send the ported code or can i submit the ported code to my >>> github repository.. ? Any suggestion ? >>> I am sending you the patch of tested code. please review the tested >>> methods. >>> >>> Thanks & Regards, >>> Aditya >>> >>> >>> >>> On Fri, May 12, 2017 at 9:41 PM, aditya upadhyay <aadit0...@gmail.com> >>> wrote: >>>> >>>> Hello Joe, Gedare, >>>> >>>> I was busy with my end semester project. I will introduce myself there. >>>> Apart from that now i am trying to make a test for inttypes library as You >>>> have told me in previous mail. I will do it by tonight. >>>> >>>> Thanks & Regards, >>>> Aditya >>>> >>>> On Fri, May 12, 2017 at 9:33 PM, Joel Sherrill <j...@rtems.org> wrote: >>>>> >>>>> Hi >>>>> >>>>> Gedare sent an email asking all students to introduce themselves and >>>>> their project to the community. You haven't done it yet. >>>>> >>>>> Thanks >>>>> >>>>> >>>>> --joel >>>> >>>> >>> > > > _______________________________________________ > devel mailing list > devel@rtems.org > http://lists.rtems.org/mailman/listinfo/devel _______________________________________________ devel mailing list devel@rtems.org http://lists.rtems.org/mailman/listinfo/devel