mdsplus icon indicating copy to clipboard operation
mdsplus copied to clipboard

Compilation error with ANSI/c90 style

Open merlea opened this issue 2 years ago • 2 comments

It seems some C++ style comments have made their way into some C headers. This breaks compilation of software depending on MDSplus includes and relying on -ansi or -std=c90 options.

Here some examples:

In file included from /usr/local/mdsplus/include/mdsdescrip.h:4,
                 from /home/gituser/codes/mds/mdsipmex.c:10:
/usr/local/mdsplus/include/mdsplus/mdsconfig.h:315:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
  315 | #endif // _MSC_VER else
      |        ^
In file included from /home/gituser/codes/mds/mdsipmex.c:10:
/usr/local/mdsplus/include/mdsdescrip.h:925:3: error: C++ style comments are not allowed in ISO C90
  925 |   // grep '} mdsdsc_' include/mdsdescrip.h | perl -n -e '/mdsdsc_([a-z]+)_t;/ &&
      |   ^
/usr/local/mdsplus/include/mdsdescrip.h:925:3: note: (this will be reported only once per input file)
In file included from /home/gituser/codes/mds/mdsipmex.c:1212:
/usr/local/mdsplus/include/mds_stdarg.h:58:1: error: C++ style comments are not allowed in ISO C90
   58 | // abbreviations for NULL and MdsEND_ARG terminated va_lists
      | ^
/usr/local/mdsplus/include/mds_stdarg.h:58:1: note: (this will be reported only once per input file)

merlea avatar Jun 13 '22 07:06 merlea

Question for MDSplus development team:

Do we want to remove all c++ style comments from MDSplus source code.  There are 55 of them.  Found by:

grep -R // . | grep .c$ | grep -v cpp | grep -v java | grep -v lvbit | grep -v sed

-Josh

On 6/13/22 3:08 AM, Antoine Merle wrote:

It seems some C++ style comments have made their way into some C headers. This breaks compilation of software depending on MDSplus includes and relying on |-ansi| or |-std=c90| options.

Here some examples:

|In file included from /usr/local/mdsplus/include/mdsdescrip.h:4, from /home/gituser/codes/mds/mdsipmex.c:10: /usr/local/mdsplus/include/mdsplus/mdsconfig.h:315:8: warning: extra tokens at end of #endif directive [-Wendif-labels] 315 | #endif // MSC_VER else | ^ In file included from /home/gituser/codes/mds/mdsipmex.c:10: /usr/local/mdsplus/include/mdsdescrip.h:925:3: error: C++ style comments are not allowed in ISO C90 925 | // grep '} mdsdsc' include/mdsdescrip.h | perl -n -e '/mdsdsc_([a-z]+)_t;/ && | ^ /usr/local/mdsplus/include/mdsdescrip.h:925:3: note: (this will be reported only once per input file) In file included from /home/gituser/codes/mds/mdsipmex.c:1212: /usr/local/mdsplus/include/mds_stdarg.h:58:1: error: C++ style comments are not allowed in ISO C90 58 | // abbreviations for NULL and MdsEND_ARG terminated va_lists | ^ /usr/local/mdsplus/include/mds_stdarg.h:58:1: note: (this will be reported only once per input file) |

— Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/2464, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABY5AZOALDO2ADDQ355RL5LVO3NAVANCNFSM5YTFRDMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Joshua Stillerman Research Engineer MIT Plasma Science and Fusion Center 617.253.8176 @.***

joshStillerman avatar Jun 13 '22 12:06 joshStillerman

A bit boring, but it can be done.

On 6/13/2022 2:17 PM, Josh Stillerman wrote:

Question for MDSplus development team:

Do we want to remove all c++ style comments from MDSplus source code. There are 55 of them.  Found by:

grep -R // . | grep .c$ | grep -v cpp | grep -v java | grep -v lvbit | grep -v sed

-Josh

On 6/13/22 3:08 AM, Antoine Merle wrote:

It seems some C++ style comments have made their way into some C headers. This breaks compilation of software depending on MDSplus includes and relying on |-ansi| or |-std=c90| options.

Here some examples:

|In file included from /usr/local/mdsplus/include/mdsdescrip.h:4, from /home/gituser/codes/mds/mdsipmex.c:10: /usr/local/mdsplus/include/mdsplus/mdsconfig.h:315:8: warning: extra tokens at end of #endif directive [-Wendif-labels] 315 | #endif // MSC_VER else | ^ In file included from /home/gituser/codes/mds/mdsipmex.c:10: /usr/local/mdsplus/include/mdsdescrip.h:925:3: error: C++ style comments are not allowed in ISO C90 925 | // grep '} mdsdsc' include/mdsdescrip.h | perl -n -e '/mdsdsc_([a-z]+)_t;/ && | ^ /usr/local/mdsplus/include/mdsdescrip.h:925:3: note: (this will be reported only once per input file) In file included from /home/gituser/codes/mds/mdsipmex.c:1212: /usr/local/mdsplus/include/mds_stdarg.h:58:1: error: C++ style comments are not allowed in ISO C90 58 | // abbreviations for NULL and MdsEND_ARG terminated va_lists | ^ /usr/local/mdsplus/include/mds_stdarg.h:58:1: note: (this will be reported only once per input file) |

— Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/2464, or unsubscribe

https://github.com/notifications/unsubscribe-auth/ABY5AZOALDO2ADDQ355RL5LVO3NAVANCNFSM5YTFRDMQ.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Joshua Stillerman Research Engineer MIT Plasma Science and Fusion Center 617.253.8176 @.***

— Reply to this email directly, view it on GitHub https://github.com/MDSplus/mdsplus/issues/2464#issuecomment-1153842886, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCLESFDPDQIJDCDJM57TNDVO4RFNANCNFSM5YTFRDMQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Gabriele Manduchi

Istituto Gas Ionizzati del CNR Consorzio RFX - Associazione EURATOM/ENEA sulla Fusione Corso Stati Uniti 4, 35127 Padova - Italy ph +39-049-829-5039/-5000 fax +39-049-8700718 @.***, http://www.igi.cnr.it

GabrieleManduchi avatar Jun 13 '22 13:06 GabrieleManduchi

We don't currently support ANSI/C90 and don't plan to support it in the future.

WhoBrokeTheBuild avatar Mar 29 '23 19:03 WhoBrokeTheBuild

Noted. Thanks.

merlea avatar Mar 30 '23 06:03 merlea