Author Topic: #if defined (__GNUC__)  (Read 275 times)

jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
#if defined (__GNUC__)
« on: October 07, 2020, 08:50:11 AM »
Kevin,
  We have several #if defined for the various compilers except for  __GNUC__ which covers NUWEN and TDMGCC
The first one I want is:
Code: [Select]
#if defined (__GNUC__) || defined (__clang__)
    #pragma GCC diagnostic ignored "-Wwrite-strings"
#endif
Thank You,
James

Edit: I added __clang__
« Last Edit: October 07, 2020, 09:04:12 AM by jcfuller »

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 714
    • View Profile
Re: #if defined (__GNUC__)
« Reply #1 on: October 07, 2020, 09:37:04 AM »
Thanks ... I'll add it to 5.7.9

JoeC4281

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: #if defined (__GNUC__)
« Reply #2 on: October 13, 2020, 08:17:10 AM »
I add these at the top of my .BAS file;

Code: [Select]
$HEADER
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
$HEADER

so that I don't have to add them as arguments during compile;

Code: [Select]
hbmk2.exe -cFlag=-Wno-unknown-pragmas -cFlag=-Wno-unused-parameter Acc365.c
Could these also be added to the;

Code: [Select]
#if defined (__GNUC__) || defined (__clang__)
section?

Joe

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 714
    • View Profile
Re: #if defined (__GNUC__)
« Reply #3 on: October 13, 2020, 10:29:56 AM »
Absolutely! 

Thanks Joe