single-line-comments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

single-line-comments

Bastian Märkisch

It seems that a C99 compiler is a prerequisite for gnuplot. It (now) requires

e.g. snprintf and union initializers. Single-line-comments were introduced in

C99, too. So why don’t we allow them? Which platform / compiler still does

not allow them?

 

  Bastian

 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: single-line-comments

Gnuplot - Dev mailing list
On Monday, 17 July 2017 10:58:21 Bastian Märkisch wrote:
> It seems that a C99 compiler is a prerequisite for gnuplot. It (now)
> requires
>
> e.g. snprintf and union initializers. Single-line-comments were introduced
> in C99, too. So why don’t we allow them? Which platform / compiler still does
> not allow them?

CC=c89 ./configure

builds and runs with no complaint once the C++ style comments are removed.
I do not know how many platforms support c89 but not c99.

snprintf() has been used in terminal code at least back to version 4.4.
By version 4.6.2 it was in the core code also.  The few explicit checks for
HAVE_SNPRINTF were vestigial protections from longer ago than that.

I don't have any particular preference for continuing to claim c89 compatibility.
I only checked because the INSTALL file for 5.2 still showed CC=c89
in the example configuration and I wondered if that really worked.
It didn't, because of the // comments.  

I agree that if we bump the requirement to c99 then the single-line
comments do not cause a problem.

        Ethan


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
gnuplot-beta mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
Loading...