AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein UInt64 Zuweisung an Integer, keine Warnung, Waum?
Thema durchsuchen
Ansicht
Themen-Optionen

UInt64 Zuweisung an Integer, keine Warnung, Waum?

Ein Thema von KodeZwerg · begonnen am 10. Feb 2022 · letzter Beitrag vom 18. Feb 2022
 
Der schöne Günther

Registriert seit: 6. Mär 2013
6.199 Beiträge
 
Delphi 10 Seattle Enterprise
 
#12

AW: UInt64 Zuweisung an Integer, keine Warnung, Waum?

  Alt 14. Feb 2022, 08:26
Nein, keines der drei scheint standardmäßig aktiv.

Vielen Dank, das macht mein Leben fortan deutlich einfacher

Delphi-Quellcode:
program Project1;

{$WARN IMPLICIT_INTEGER_CAST_LOSS ON}
{$WARN IMPLICIT_CONVERSION_LOSS ON}
{$WARN COMBINING_SIGNED_UNSIGNED64 ON}

uses System.SysUtils;

var
   someByte: Byte;
   someShort: ShortInt;
   someInt: Integer;
   someUInt64: UInt64;
begin
   // W1071 Implicit integer cast with potential data loss from 'Byte' to 'ShortInt'
   someByte := ShortInt.MaxValue + 1;
   someShort := someByte;

   // W1072 Implicit conversion may lose significant digits from 'UInt64' to 'Integer'
   someUInt64 := UInt64.MaxValue;
   someInt := someUInt64;

   // W1073 Combining signed type and unsigned 64-bit type - treated as an unsigned type
   someUInt64 := someInt + someUInt64;
end.
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz