Skip to content

GCC + win32a: warning: C++ style comments are not allowed in ISO C90 #37

Closed

Description

@GitMensch

Got these on my "old" mingw environment and in the cygwin64 environment with make -f mingwin32.mak DLL=Y:

gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdcclip.c
../win32a/pdcclip.c: In function 'PDC_setclipboard_raw':
../win32a/pdcclip.c:123:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 //  printf( "%ld bytes: %x %x %x %x\n", length,
 ^
../win32a/pdcclip.c:123:1: warning: (this will be reported only once per input file) [enabled by default]
gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdcdisp.c
../win32a/pdcdisp.c:10:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 // #ifdef CHTYPE_LONG
 ^
../win32a/pdcdisp.c:10:1: warning: (this will be reported only once per input file) [enabled by default]
gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdcgetsc.c
gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdckbd.c
../win32a/pdckbd.c: In function 'PDC_add_clipboard_to_key_queue':
../win32a/pdckbd.c:65:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 //          _tcscpy( clipboard_contents, (TCHAR *)handle);
 ^
../win32a/pdckbd.c:65:1: warning: (this will be reported only once per input file) [enabled by default]
gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdcscrn.c
../win32a/pdcscrn.c: In function 'HandleSize':
../win32a/pdcscrn.c:1571:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 //  if( wine_version)
 ^
../win32a/pdcscrn.c:1571:1: warning: (this will be reported only once per input file) [enabled by default]
gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdcsetsc.c
../win32a/pdcsetsc.c: In function 'PDC_set_blink':
../win32a/pdcsetsc.c:87:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 //  if (pdc_color_started)       /* We've got 256 colors in this version */
 ^
../win32a/pdcsetsc.c:87:1: warning: (this will be reported only once per input file) [enabled by default]
gcc -c -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD ../win32a/pdcutil.c
echo LIBRARY pdcurses > pdcurses.def
echo EXPORTS >> pdcurses.def
cat ../exp-base.def >> pdcurses.def
gcc pdcurses.def -Wl,--out-implib,pdcurses.a -shared -o pdcurses.dll addch.o addchstr.o addstr.o attr.o beep.o bkgd.o border.o clear.o color.o delch.o deleteln.o deprec.o getch.o getstr.o getyx.o inch.o inchstr.o initscr.o inopts.o insch.o insstr.o instr.o kernel.o keyname.o mouse.o move.o outopts.o overlay.o pad.o panel.o printw.o refresh.o scanw.o scr_dump.o scroll.o slk.o termattr.o terminfo.o touch.o util.o window.o debug.o pdcclip.o pdcdisp.o pdcgetsc.o pdckbd.o pdcscrn.o pdcsetsc.o pdcutil.o pdcurses.def -lgdi32 -lcomdlg32
cp pdcurses.a panel.a
gcc -O4 -Wall -pedantic -I.. -DPDC_DLL_BUILD -mwindows -otestcurs.exe ../demos/testcurs.c pdcurses.dll
../demos/testcurs.c: In function 'inputTest':
../demos/testcurs.c:455:1: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
 //  PDC_return_key_modifiers(TRUE);
 ^

looks like an easy fix: surround them by #ifdef 0 /* comment why this isn't active */ instead of commenting the lines by //.

Activity

  1. changed the title [-]GCC warnings in win32a[/-] [+]GCC + win32a: warning: C++ style comments are not allowed in ISO C90[/+] on May 7, 2017
  2. Bill-Gray commented on May 8, 2017

    @Bill-Gray
    Owner

    Yup, you're right, and it was an easy fix (just pushed the changes). I removed most of those comments and converted the rest to C-style comments or #iffed them out. I'm surprised none of the other assorted compilers I've used warned about that!

  3. GitMensch commented on May 8, 2017

    @GitMensch
    CollaboratorAuthor

    The warnings are fixed with current master.

  4. GitMensch commented on Dec 2, 2018

    @GitMensch
    CollaboratorAuthor

    Back in tui.c:

    gcc -c -O4 -Wall -pedantic -I.. -I../demos -otui.o ../demos/tui.c
    ../demos/tui.c: In function 'mainmenu':
    ../demos/tui.c:264:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
         MEVENT mouse_event;
         ^
    ../demos/tui.c: In function 'domenu':
    ../demos/tui.c:537:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
         MEVENT mouse_event;
         ^
    ../demos/tui.c:620:40: warning: C++ style comments are not allowed in ISO C90 [enabled by default]
                             key = KEY_ESC; //exit menu
                                            ^
    ../demos/tui.c:620:40: warning: (this will be reported only once per input file) [enabled by default]
    
  5. Bill-Gray commented on Dec 27, 2018

    @Bill-Gray
    Owner

    Fixed. (Also led me to search for and remove a couple of other C++-style '//' comments.) I can only replicate this problem by adding the --std=c90 flag. That also leads to a problem in the VT flavor where it appears the signal handling functions are simply absent; it appears to me that the VT flavor cannot be compiled on a C90 compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions