NO

Author Topic: Error with "Preprocess only" option (/E) (version 11.00)  (Read 3230 times)

Offline mangel24

  • Member
  • *
  • Posts: 1
Error with "Preprocess only" option (/E) (version 11.00)
« on: August 10, 2021, 11:27:22 PM »
"cc /E prog.c" works fine with version 10.00. But with version 11.00 I get an error:

"Unable to find or execute POCC.EXE"

prog.c:

Code: [Select]
#include <stdio.h>
int main ( void )
{
  puts("Hello");
  return 0;
}

Offline MrBcx

  • Global Moderator
  • Member
  • *****
  • Posts: 191
    • Bcx Basic to C/C++ Translator
Re: Error with "Preprocess only" option (/E) (version 11.00)
« Reply #1 on: August 11, 2021, 04:36:10 AM »
I've never used cc.exe so I'm not an expert on its use.  That said, /E is a valid option
for pocc.exe but /E does not appear on the list of options for cc.exe  ( see below ). 
That cc /E partially works may simply be a fluke.


Pelles Compiler Driver, Version 11.00.0
Copyright (c) Pelle Orinius 2002-2021

Syntax:
CC [options]
   [@commandfile]
   { [compiler options] filename1.c [filename2.c ...] |
     [assembler options] filename1.asm [filename2.asm ...] }
   [filename1.rc [filename2.rc ...]]
   [linker options]
   [options]

Options:
/a             Send assembly files to the C compiler (compatibility)
/c             Compile only, no link
/o<file>       Name the output file; either /Fe or /Fo
/Fe<execfile>  Name the executable file
/Fo<outfile>   Name the output file
/x             Don't set environment from the Registry


Compiler options: see POCC
Assembler options: see POASM
Linker options: see POLINK
« Last Edit: August 11, 2021, 04:40:02 AM by MrBcx »
Bcx Basic to C/C++ Translator
https://www.BcxBasicCoders.com

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Error with "Preprocess only" option (/E) (version 11.00)
« Reply #2 on: August 11, 2021, 06:42:33 AM »
In my test
Code: [Select]
@C:\code\PellesC11\bin\cc.exe /E hello.cswitch /E works once, but after that
Code: [Select]
extern __declspec(nodiscard) FILE * __cdecl _popen(const char *, const char *);
fatal error: Internal error: 'Access violation' at 0x00000000771fa1ff.

Code: [Select]
SET PATH=C:\code\PellesC11\bin
cc.exe /E prog.c
pocc.exe crash while prosessing file in Windows 7
Code: [Select]
...
extern __declspec(nodiscard) FILE * __cdecl _popen(const char *, const char *);
fatal error: Internal error: 'Access violation' at 0x00000000771fa1ff.
or
Code: [Select]
extern __declspec(nodiscard) FILE * __cdecl _popen(const char *, const char *);
Unable to find or execute POCC.EXE

option /P works
« Last Edit: August 11, 2021, 07:05:19 AM by TimoVJL »
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Error with "Preprocess only" option (/E) (version 11.00)
« Reply #3 on: August 11, 2021, 10:27:05 AM »
pocc command line switches in version 10 - match version 11
cc commands match too as MrBcx showed.

I would try using pocc directly with /E if that works it would appear to be an issue with cc.
then try cc after changing to the BIN directory.....because the error seems to be locating POCC


John Z
« Last Edit: August 11, 2021, 11:50:20 AM by John Z »

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: Error with "Preprocess only" option (/E) (version 11.00)
« Reply #4 on: August 11, 2021, 04:30:05 PM »
A this issue depends Windows OS version, so hopefully people inform in bug report also a Windows OS version too.

As poide have -x -xml commandline options, people can have several Pelles C versions in same PC  :)
Just make a zip-package from Pelles C folder to USB-sticks.

I have Pelles C versions from 2.50 ->

EDIT:
Perhaps a safer way to test between versions
Code: [Select]
SET PellesCDirX=C:\code\PellesC11
SET PATH=%PellesCDirX%\bin
SET INCLUDE=%PellesCDirX%\include
SET LIB=%PellesCDirX%\lib;%PellesCDirX%\lib\Win
cc.exe -x -c -E prog.c
PAUSE
« Last Edit: August 11, 2021, 10:12:00 PM by TimoVJL »
May the source be with you

Offline John Z

  • Member
  • *
  • Posts: 860
Re: Error with "Preprocess only" option (/E) (version 11.00)
« Reply #5 on: August 11, 2021, 05:03:33 PM »
A this issue depends Windows OS version, so hopefully people inform in bug report also a Windows OS version too.

Very good point!  Also should check IDE settings because help file indicates cc gets information from IDE not environment variables.

John Z

PS running windows 7 and windows 10  (last year I gave up on Windows ME  ;D )

remove old attachment to free upload space
« Last Edit: August 17, 2022, 04:36:12 PM by John Z »