• AVR Freaks

Hot!xc16-gcc.exe uses stdout instead stderr with the gcc option "-v"

Author
spash
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/09/25 01:55:21
  • Location: 0
  • Status: offline
2019/09/26 01:40:32 (permalink)
0

xc16-gcc.exe uses stdout instead stderr with the gcc option "-v"

Hi,
We discovered recently an issue with  xc16-gcc.exe and xc32-gcc.exe regarding the behavior of the -v option.
 
The GCC documentation (https://gcc.gnu.org/onlin....html#Overall-Options) states:
-v
Print (on standard error output) the commands executed to run the stages of compilation.
Also print the version number of the compiler driver program and of the preprocessor and the compiler proper.

 
It appears that xc16-gcc.exe and xc32-gcc.exe print the "version number & proper" not on stderr but on stdout. This makes break third party tools that analye the output of the compiler (static code analysis tools like Sonarqube).
 
Ex on Windows:
gcc.exe -v 2>NUL

will return nothing, because of stderr redirection to NUL. This is the expected behavior.
 
xc32-gcc will return:
C:\Program Files (x86)\Microchip\xc32\v2.10\bin>xc32-gcc -v 2>NUL
Microchip Language Tool Shell Version 2.05 (Build date: May 4 2018).
Copyright (c) 2012-2017 Microchip Technology Inc. All rights reserved

 
We have the same issue with xc16-gcc.
Best regards,
#1

4 Replies Related Threads

    jfd
    Administrator
    • Total Posts : 26
    • Reward points : 23
    • Status: offline
    Re: xc16-gcc.exe uses stdout instead stderr with the gcc option "-v" 2019/09/26 08:29:49 (permalink)
    0
    Thanks, we've entered a bug report and will address this.
    #2
    cawilkie
    Administrator
    • Total Posts : 1983
    • Reward points : 0
    • Joined: 2003/11/07 12:49:11
    • Status: offline
    Re: xc16-gcc.exe uses stdout instead stderr with the gcc option "-v" 2019/11/06 07:35:40 (permalink)
    0
    I can only speak for XC16, but the version of GCC source base that we use prints to stdout, not stderr.
     
    Perhaps the OP was looking at online GCC docs for a later version of GCC.
     
    Regards
    Calum
    #3
    spash
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/09/25 01:55:21
    • Location: 0
    • Status: offline
    Re: xc16-gcc.exe uses stdout instead stderr with the gcc option "-v" 2019/11/12 02:09:08 (permalink)
    0
    Hi,
     
    >but the version of GCC source base that we use prints to stdout, not stderr.
    This may be the root cause. Do you have a version matrix between the xc-gcc versions and the original gcc versions they are based on ?
     
    >Perhaps the OP was looking at online GCC docs for a later version of GCC.
    By looking to the gcc documentation, the -v option to output to stderr is defined like this starting at least from 4.3.2 to 9.2.0 (latest) version of gcc.
     
    Best regards,
     
    #4
    cawilkie
    Administrator
    • Total Posts : 1983
    • Reward points : 0
    • Joined: 2003/11/07 12:49:11
    • Status: offline
    Re: xc16-gcc.exe uses stdout instead stderr with the gcc option "-v" 2019/11/12 07:26:59 (permalink)
    0
    I do not see that in the code.  xcnn-gcc --version will display the GCC version number that it is based on.
     
    XC16 is based on 4.5.1, and the GCC driver prints everything to stdout.  We have no need to change that.  
     
    Regards
    Calum
    #5
    Jump to:
    © 2019 APG vNext Commercial Version 4.5