Hi Andrew: I am going to pass this decision about the correct way to avoid that long string over to Arjen. See below.
On 2011-10-28 14:04+0100 Andrew Ross wrote: > Alan: I've noticed one issue that you might want to look at. The file > bindings/tcl/plplot_parameters.h is generated by a sed script. It > creates a large string of commands to pass to the tcl interpreter. > Unfortunately the length of this string (currently 5296) is greater > than the string length which compilers are required to support under > the ISO C99 standard (4096 characters). The length is even less for > C89. I don't know whether any compilers enforce this limit, but > it would be prudent to avoid this long static string. Possibilities > include splitting it up into several smaller strings, or dynamically > allocating the string (can be any size) and then copying in the > commands in smaller chunks. I've also changed how this header is > included slightly. Since it is a static function copies were being > included in a number of object files which didn't actually use > the function. Hi Arjen: bindings/tcl/plplot_parameters.h was your original creation so could you have a look at it to see how to reformat it to avoid the long string that violates C standards that Andrew referred to above? I am involved in this to a certain extent because I am the author of the custom target called check_tcl_parameters (see bindings/tcl/CMakeLists.txt). That target uses the "sed" command to process the #defines in bindings/swig-support/plplotcapi.i to create a check version called bindings/tcl/plplot_parameters.h_compare in the build tree. It then uses the "cmp" command to check the consistency between that check version and bindings/tcl/plplot_parameters.h. Just now I made some changes in bindings/tcl/global_defines.sed so that it produces styled results. Therefore as of revision 12013 the check_tcl_parameters target generates a check version that is in exact agreement with our already existing styled version of bindings/tcl/plplot_parameters.h. By the way, I adopted this method of checking bindings/tcl/plplot_parameters.h for consistency rather than simply generating that file, because not all platforms have access to sed. Note, that once you decide on the appropriate format for bindings/tcl/plplot_parameters.h to avoid the long string, there should be no necessity for hand crafting bindings/tcl/plplot_parameters.h. Instead, please let me know what format you desire, and I can do the rest with the appropriate changes to the sed script and copying the resulting bindings/tcl/plplot_parameters.h_compare back to bindings/tcl/plplot_parameters.h. Alternatively, you do have access to both the sed and cmp commands via MSYS. So you have the opportunity of changing the sed script yourself, running the check_tcl_parameters target, and looking at the resulting bindings/tcl/plplot_parameters.h_compare to make sure it has your desired format. I could help you with the sed part of this if your sed knowledge is a little rusty (or currently nonexistent). Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Plplot-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plplot-devel
