pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #16941: ECPG add support for const void*
3+ messages / 3 participants
[nested] [flat]

* BUG #16941: ECPG add support for const void*
@ 2021-03-23 16:07 PG Bug reporting form <noreply@postgresql.org>
  2021-03-24 05:36 ` Re: BUG #16941: ECPG add support for const void* Matthias Apitz <guru@unixarea.de>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Bug reporting form @ 2021-03-23 16:07 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: bryan.w.staley@gmail.com

The following bug has been logged on the website:

Bug reference:      16941
Logged by:          Bryan Staley
Email address:      bryan.w.staley@gmail.com
PostgreSQL version: 13.1
Operating system:   RHEL 7
Description:        

The following doesn't compile via ecpg

```
EXEC SQL BEGIN DECLARE SECTION;
  static const char[2] TEST = "F";
EXEC SQL END DECLARE SECTION;
```

Fails with
error: invalid conversion from 'const void*' to 'void*'



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #16941: ECPG add support for const void*
  2021-03-23 16:07 BUG #16941: ECPG add support for const void* PG Bug reporting form <noreply@postgresql.org>
@ 2021-03-24 05:36 ` Matthias Apitz <guru@unixarea.de>
  2021-03-24 13:41   ` Re: BUG #16941: ECPG add support for const void* Bryan Staley <bryan.w.staley@gmail.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Matthias Apitz @ 2021-03-24 05:36 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; bryan.w.staley@gmail.com

El día martes, marzo 23, 2021 a las 04:07:01p. m. +0000, PG Bug reporting form escribió:

> The following bug has been logged on the website:
> 
> Bug reference:      16941
> Logged by:          Bryan Staley
> Email address:      bryan.w.staley@gmail.com
> PostgreSQL version: 13.1
> Operating system:   RHEL 7
> Description:        
> 
> The following doesn't compile via ecpg
> 
> ```
> EXEC SQL BEGIN DECLARE SECTION;
>   static const char[2] TEST = "F";
> EXEC SQL END DECLARE SECTION;
> ```
> 
> Fails with
> error: invalid conversion from 'const void*' to 'void*'
> 

This would not even compile:

$ cc -v
FreeBSD clang version 11.0.0 (git@github.com:llvm/llvm-project.git llvmorg-11.0.0-0-g176249bd673)
Target: x86_64-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin

$ cat c.c

static const char[2] TEST = "F";

$ cc c.c
c.c:2:26: error: brackets are not allowed here; to declare an array, place the brackets after the identifier
static const char[2] TEST = "F";
                 ~~~     ^
                         [2]
1 error generated.



-- 
Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
¡Con Cuba no te metas!  «»  Don't mess with Cuba!  «»  Leg Dich nicht mit Kuba an!
http://www.cubadebate.cu/noticias/2020/12/25/en-video-con-cuba-no-te-metas/





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #16941: ECPG add support for const void*
  2021-03-23 16:07 BUG #16941: ECPG add support for const void* PG Bug reporting form <noreply@postgresql.org>
  2021-03-24 05:36 ` Re: BUG #16941: ECPG add support for const void* Matthias Apitz <guru@unixarea.de>
@ 2021-03-24 13:41   ` Bryan Staley <bryan.w.staley@gmail.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Bryan Staley @ 2021-03-24 13:41 UTC (permalink / raw)
  To: Matthias Apitz <guru@unixarea.de>; +Cc: pgsql-bugs@lists.postgresql.org

My bad...

Try

EXEC SQL BEGIN DECLARE SECTION;
  static const char TEST[2] = "F";
EXEC SQL END DECLARE SECTION;

On Tue, Mar 23, 2021 at 11:36 PM Matthias Apitz <guru@unixarea.de> wrote:

> El día martes, marzo 23, 2021 a las 04:07:01p. m. +0000, PG Bug reporting
> form escribió:
>
> > The following bug has been logged on the website:
> >
> > Bug reference:      16941
> > Logged by:          Bryan Staley
> > Email address:      bryan.w.staley@gmail.com
> > PostgreSQL version: 13.1
> > Operating system:   RHEL 7
> > Description:
> >
> > The following doesn't compile via ecpg
> >
> > ```
> > EXEC SQL BEGIN DECLARE SECTION;
> >   static const char[2] TEST = "F";
> > EXEC SQL END DECLARE SECTION;
> > ```
> >
> > Fails with
> > error: invalid conversion from 'const void*' to 'void*'
> >
>
> This would not even compile:
>
> $ cc -v
> FreeBSD clang version 11.0.0 (git@github.com:llvm/llvm-project.git
> llvmorg-11.0.0-0-g176249bd673)
> Target: x86_64-unknown-freebsd13.0
> Thread model: posix
> InstalledDir: /usr/bin
>
> $ cat c.c
>
> static const char[2] TEST = "F";
>
> $ cc c.c
> c.c:2:26: error: brackets are not allowed here; to declare an array, place
> the brackets after the identifier
> static const char[2] TEST = "F";
>                  ~~~     ^
>                          [2]
> 1 error generated.
>
>
>
> --
> Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/
> +49-176-38902045
> Public GnuPG key: http://www.unixarea.de/key.pub
> ¡Con Cuba no te metas!  «»  Don't mess with Cuba!  «»  Leg Dich nicht mit
> Kuba an!
> http://www.cubadebate.cu/noticias/2020/12/25/en-video-con-cuba-no-te-metas/
>

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-03-24 13:41 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-23 16:07 BUG #16941: ECPG add support for const void* PG Bug reporting form <noreply@postgresql.org>
2021-03-24 05:36 ` Matthias Apitz <guru@unixarea.de>
2021-03-24 13:41   ` Bryan Staley <bryan.w.staley@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox