Ticket #40502

gcc on msys2 the compiler is failing

Eröffnet am: 2020-06-24 05:26 Letztes Update: 2020-06-24 07:14

Auswertung:
Verantwortlicher:
(Keine)
Typ:
Status:
Geschlossen
Komponente:
Priorität:
8
Schweregrad:
5 - Mittel
Lösung:
Ungültiger
Datei:
Keine
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

When I use gcc on MSYS2 Package

Installation: pacman -S mingw-w64-x86_64-gcc Version: 10.1.0-3 Build Date: 2020-06-01 11:25:47

ld -v: GNU ld (GNU Binutils) 2.34 MINGW64_NT-10.0-18362 Fx 3.1.5-340.x86_64 2020-06-06 09:16 UTC x86_64 Msys

I get a problem from this sample code:


  1. // myproject.c
  2. #include <stdio.h>
  3. #include <string.h>
  4. #define PROJECT_NAME "myproject"
  5. char *x(char *name) {
  6. char a[100]="Hello ";
  7. return strcat(a, name);
  8. }
  9. int main(int argc, char **argv) {
  10. printf("%s\n", x("fer"));
  11. return 0;
  12. }

I compile it but it's working bad :(, then I run :

command output

|| gcc -o a1 myproject.c || $ ./a1.exe This is project myproject. ■d

||

please give me suggestion because i try it on linux, I thins the code is ok.

Ticket-Verlauf (2/2 Historien)

2020-06-24 05:26 Aktualisiert von: xero
  • New Ticket "gcc on msys2 the compiler is failing" created
2020-06-24 07:14 Aktualisiert von: keith
  • Status Update from Offen to Geschlossen
  • Lösung Update from Keine to Ungültiger
Kommentar

<sigh>How many times must I reject such invalid tickets?</sigh>

MSYS2 is not a MinGW.org product ... indeed, their use of "mingw" within their product name infringes our registered trademark. We do not offer support for any product from such rogue projects, but in any case, it is your code which is broken ... it is a classical example of "undefined behaviour".

(Edited, 2020-06-24 07:17 Aktualisiert von: keith)

Dateianhangliste

Keine Anhänge

Bearbeiten

Please login to add comment to this ticket » Anmelden