Author Topic: What's your .NAME? Shootin' you straight, ... ?  (Read 827 times)

Robert

  • Hero Member
  • *****
  • Posts: 1142
    • View Profile
What's your .NAME? Shootin' you straight, ... ?
« on: August 19, 2022, 11:44:51 PM »
BCX 7.9.2 line 24296
 
Code: [Select]
strcpy(COM_gl_names[COM_gl_names_free_index].NAME, p_name)
 should be
 
 
Code: [Select]
strcpy(COM_gl_names[COM_gl_names_free_index].name, p_name) 
Line 24317

Code: [Select]
    strcpy(COM_lc_names[COM_lc_names_free_index].NAME, p_name)   
should be

Code: [Select]
    strcpy(COM_lc_names[COM_lc_names_free_index].name, p_name)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1885
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #1 on: August 20, 2022, 01:17:08 AM »
Hi Robert,

Those errors don't exist in my archive. 

Moments ago, I downloaded the zip from the Announcements page and the errors don't exist there either.  There was a revision to 792 posted the day after I posted 792 the first time which involved removing some (at that time) recently placed (void*) casts to silence some compiler warnings, per a request by James Fuller.  When formatting code with BED, the case of "name" is not altered.  But its possible the 2nd upload of 792 was formatted with a different version of BED than the first upload, as I was doing a lot of work on BED at that time too.

If you have the original 792 zip ( I don't ) and it contains the errors then that could explain it.  Otherwise, it's a mystery.

https://bcxbasiccoders.com/smf/index.php?topic=754.0


Robert

  • Hero Member
  • *****
  • Posts: 1142
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #2 on: August 20, 2022, 01:31:57 AM »
O.K. Re-downloaded.

I must've misplaced the revision, because I do remember downloading it.

Anyway, there are two (INT)LEN calls in that COM neighborhood that cause an (int)(int)strlen.

(int)(int) sounds like two kids arguing.

Still thinking about Lynyrd Skynyrd back at the hotel.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1885
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #3 on: August 20, 2022, 01:45:38 AM »

Anyway, there are two (INT)LEN calls in that COM neighborhood that cause an (int)(int)strlen.


I understand ...  STR$(INT) is translated to (int)(int). 

I found only two instances and both have now been changed in 793.

Something good came out of this after all ... except now I can't get that Skynyrd song out of my head.

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1885
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #4 on: August 20, 2022, 01:16:45 PM »
Going back to the original bug report, I've decided to help mitigate
possible future recurrences by changing the member name

from this

TYPE COM_NAMES_STORAGE     ' Used for COM variables
    name [cSizeOfName] AS CHAR
    initialized                  AS BOOL
END TYPE

to this

TYPE COM_NAMES_STORAGE     ' Used for COM variables
    com_VarName[cSizeOfName] AS CHAR
    initialized              AS BOOL
END TYPE

Robert

  • Hero Member
  • *****
  • Posts: 1142
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #5 on: June 27, 2023, 04:54:47 PM »
Going back to the original bug report, I've decided to help mitigate
possible future recurrences by changing the member name

from this

TYPE COM_NAMES_STORAGE     ' Used for COM variables
    name [cSizeOfName] AS CHAR
    initialized                  AS BOOL
END TYPE

to this

TYPE COM_NAMES_STORAGE     ' Used for COM variables
    com_VarName[cSizeOfName] AS CHAR
    initialized              AS BOOL
END TYPE


Hi MrBCX:

What about BCX 8.0.0, line 2222 ?

Code: [Select]
    { 1, "name"                   , "name"                          , 2, comvt_BAD },
Is that entry there because of its former inclusion, before you kicked it out for "com_VarName", in the TYPE COM_NAMES_STORAGE structure ?

Can it be removed from the "SET BCXWords[] AS tagTokenSubFunctions" list ?

I use that list to keep my BCX_Keywords.inc file up to date and today, when formatting Example C19.bas in the 'The C++ Tutorial for BCX Users' section, the user defined variable "name" in Example C19 was capitalized when I used my BCB.

Of course I can simply remove it from my list but there may be others who have had the same problem with a variable named "name".

 

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1885
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #6 on: June 27, 2023, 06:58:49 PM »
Hi Robert ... I'll have a look at it and will update, if that's what's needed. 

Thanks

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1885
    • View Profile
Re: What's your .NAME? Shootin' you straight, ... ?
« Reply #7 on: June 27, 2023, 07:25:48 PM »
Hi Robert ... I'll have a look at it and will update, if that's what's needed. 

Thanks

Robert,


I could not find any dependency on "name" within the translator.

I removed line 2222, rebuilt BCX, and ran a quick regression test.

All seems well, so I'll make the change permanent in 8.0.1.

Here is the first entry to the future 8.0.1 Revision.txt:


**********************************************************************************************
2023/06/28       Changes in 8.0.1 from 8.0.0
**********************************************************************************************
Robert Wishlaw : Reported dead code related to "name".
                 Removed by MrBcx because "name" is not a reserved word in BCX.


Thanks again for all the
HELP! you've given us over the years.
« Last Edit: June 27, 2023, 08:38:29 PM by MrBcx »