Re: [fpc-devel] Error: Global Generic template references static symtable

2021-01-10 Thread Bart via fpc-devel
On Sun, Jan 10, 2021 at 11:59 AM Sven Barth via fpc-devel
 wrote:

> Displaying the message at the correct location would be more involved...
> you might want to open a bug report for that so that it's remembered
> somewhere, but it's definitely going to be a low priority one.

https://bugs.freepascal.org/view.php?id=38342

-- 
Bart
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Proposal for implementing named address space support

2021-01-10 Thread Jonas Maebe via fpc-devel

On 2021-01-09 16:01, Christo Crause via fpc-devel wrote:

On Sat, Jan 9, 2021 at 3:52 PM Jonas Maebe via fpc-devel 
 wrote:


Could your idea not be simplified by allowing the use of the section 
directive when defining a pointer?

type
Peeprom = pointer; section '.eeprom';

This way when a parameter is defined as e.g. type Peeprom the compiler 
knows what access code should be generated for the specified section.  
It would also help with compile time error checking where assigning a 
regular pointer to a section pointer should not be allowed (unless the 
user applies a type cast).


Something like that is definitely possible (and is similar to how LLVM 
handles cases like this: every pointer by default is in address space 0, 
but you can define as many additional address spaces as you want and 
associate pointers with them). However, it does not solve the issue with 
call-by-reference parameters. You can of course only allow those for the 
default address space, and require explicit pointers for other address 
spaces.



Jonas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Error: Global Generic template references static symtable

2021-01-10 Thread Sven Barth via fpc-devel

Am 09.01.2021 um 16:21 schrieb Bart via fpc-devel:



The *why* is not important for users. Those that are interested can ask, just 
like you did.

Then let me rephrase it.
Error messages of the compiler normally point you in the right direction like:
   qtest.lpr(367,3) Fatal: Syntax error, ";" expected but "identifier
TESTINCCAP" found
It's sort of obvious there is a missing semicolon.

OTOH: "Global Generic template references static symtable" only means
something to me (as an fpc user) if I know what a static symtable is
(I assume this is an internal datastructure in the compiler).
Since I have no clue, I have absolutely no idea how to fix that error.
In my case I commented out all lines in the given procedure and
uncommented them one by one to finally get at the offending line in
question.
I then made an educated guess that (sine accessing functions like
Format() is OK), it must have something to do with the declaration of
the "Min()" function.

It would have helped if the error message was a little less cryptic,
and/or if it pointed to the line that caused the error in the first
place.

I have clarified the message a bit.

Displaying the message at the correct location would be more involved... 
you might want to open a bug report for that so that it's remembered 
somewhere, but it's definitely going to be a low priority one.


Regards,
Sven
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel