Author Topic: VS 2019 16.8.1 BIG issues  (Read 216 times)

jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
VS 2019 16.8.1 BIG issues
« on: November 14, 2020, 11:02:25 AM »
I just updated Visual Studio 2019 to build 16.8.1 and I can't build the BCX translator anymore.
I thought it built with 16.8 ?? but not sure.
These are not warnings that can be hidden they are errors.

James


Code: [Select]
Using Visual Studio BuildTools 2019
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.8.1
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
Compiling "bc.cpp" To " a Windows Console App"
bc.cpp
bc.cpp(1796): error C2440: 'initializing': cannot convert from 'const char [5]' to 'PCHAR'
bc.cpp(1796): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1797): error C2440: 'initializing': cannot convert from 'const char [5]' to 'PCHAR'
bc.cpp(1797): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1798): error C2440: 'initializing': cannot convert from 'const char [8]' to 'PCHAR'
bc.cpp(1798): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1799): error C2440: 'initializing': cannot convert from 'const char [8]' to 'PCHAR'
bc.cpp(1799): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1800): error C2440: 'initializing': cannot convert from 'const char [6]' to 'PCHAR'
bc.cpp(1800): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1801): error C2440: 'initializing': cannot convert from 'const char [5]' to 'PCHAR'
bc.cpp(1801): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1802): error C2440: 'initializing': cannot convert from 'const char [6]' to 'PCHAR'
bc.cpp(1802): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1803): error C2440: 'initializing': cannot convert from 'const char [5]' to 'PCHAR'
bc.cpp(1803): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1804): error C2440: 'initializing': cannot convert from 'const char [7]' to 'PCHAR'
bc.cpp(1804): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1805): error C2440: 'initializing': cannot convert from 'const char [7]' to 'PCHAR'
bc.cpp(1805): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1806): error C2440: 'initializing': cannot convert from 'const char [5]' to 'PCHAR'
bc.cpp(1806): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1807): error C2440: 'initializing': cannot convert from 'const char [7]' to 'PCHAR'
bc.cpp(1807): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1808): error C2440: 'initializing': cannot convert from 'const char [5]' to 'PCHAR'
bc.cpp(1808): note: Conversion from string literal loses const qualifier (see /Zc:strictStrings)
bc.cpp(1809): error C2440: 'initializing': cannot convert from 'const char [6]' to 'PCHAR'

[/cdoe]

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 714
    • View Profile
Re: VS 2019 16.8.1 BIG issues
« Reply #1 on: November 14, 2020, 11:23:35 AM »
Untested but maybe helpful ...

The /Zc:strictStrings option is off by default. (Maybe VS19 changed this???)

The /permissive- compiler option implicitly sets this option, but it can be overridden by using /Zc:strictStrings-

( The above wording is confusing to me )

https://docs.microsoft.com/en-us/cpp/build/reference/zc-strictstrings-disable-string-literal-type-conversion?view=msvc-160


jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
Re: VS 2019 16.8.1 BIG issues
« Reply #2 on: November 14, 2020, 11:38:06 AM »
Kevin,
  I found the same error in one of my sources and tried /Zc:strictStrings- but still got the error.

James

jcfuller

  • Sr. Member
  • ****
  • Posts: 268
    • View Profile
Re: VS 2019 16.8.1 BIG issues
« Reply #3 on: November 14, 2020, 11:46:19 AM »
I think I tracked it down.
I was using
/std:c++latest
changed to
/std:c++14

Seems to be OK

Update: Also OK with /std:c++17

James
« Last Edit: November 14, 2020, 11:50:30 AM by jcfuller »

Robert

  • Hero Member
  • *****
  • Posts: 555
    • View Profile
Re: VS 2019 16.8.1 BIG issues
« Reply #4 on: January 01, 2021, 04:32:34 AM »
I think I tracked it down.
I was using
/std:c++latest
changed to
/std:c++14

Seems to be OK

Update: Also OK with /std:c++17

James

Hi James:

This looks like a bug in /std:c++latest not translating PCHAR correctly.

I changed

Code: [Select]
PCHAR

to

Code: [Select]
char *
in the .cpp code and it compiled O.K. with  /std:c++latest. It, in this case, being MrBCX's example of multiple local DATA sets using the READ$ function which contains two CONST PCHAR blocks.

I've been exploring the UTF-8 capabilities of BCX and at the moment am wondering if PUCHAR may be needed where there are char pointers, particularly, where there is byte examination occurring, as for example, in the BCX RemoveAll SUB. Anyway, this trope is drifting off topic so I will leave it at that, with a Happy New Year 2021 to all.